Callback for Google Play Ads (android.googleAdUnitId or ios.googleAdUnitId build hints) - callback

My CodenameOne app works perfectly when using the android.googleAdUnitId or ios.googleAdUnitId build hints in order to show the Admob Ads banner at the bottom. However, I would like to give some coins/diamonds as rewards when users click on the bottom Ads banner. How can I do this? Is it possible for the main class to handle this by implementing the AdsListener interface like the https://github.com/chen-fishbein/admobfullscreen-codenameone supports (or at least the main class should implement a special interface which has the onAdLeftApplication() function only?)
Shai, Chen, anyone, do you have any advice?

There is no way to adjust the banner behavior, if you want to reward the user use full screen ads, there are quite a few full screen ads providers with a CodenameOne integration see these:
https://github.com/chen-fishbein/flurry-codenameone , https://github.com/chen-fishbein/startapp-codenameone , https://github.com/amiga/aerserv-codenameone

Related

Chartboost Unity plugin Video rewards always pop up 'reward 1 coins' message ,how can I change it?

This message seems no where to modify both in the plugin files or website console. Actually,this should be configurable,because each game won't have the same reward.I wanner just change it to 20 coins reward or not let it appear.
The real rewards will deal with in the complete callback so I don't need such message.
Anyone knows can help?
Thanks!
Here you have an input:
Move to your Chartboost dashboard and select your app. Once selecte, on the left panel (if using the new dashboard) click on Settings -> Rewarded Video.
There you have two inputfields: Currency name and reward per view.
You can also add custom content to ads. Here you can read more about it:
https://answers.chartboost.com/hc/en-us/articles/201220195-Creatives
Hope it helps!

Add a "Add Event" Page in your iOS App

I was wondering is there a way to add the following Add event screen to your iOS app, without actually creating it yourself, something like a method [show UIAddEvent].
Please let me know if there is way to do this.
Click to see Add Event Screen Image
You want the EventKitUI framework.
EKEventEditViewController is probably what you are looking for. The SimpleEKDemo sample on the developer site should get you started.

Facebook chat hides Flash apps when open

While running a Flash app, if I open a new or existing Facebook chat window, my Flash content disappears. I can continue to hear music playing from the app and when I close/minimize the Facebook chat window, my Flash content reappears. Is this a known issue?
This is happening in Google Chrome 15 and Internet Explorer 9 on Windows 7 with Flash Player 11.
I checked this on my own Flash app as well as on another Flash app made by someone else and the same behaviour is occurring. It does not however hide non-Flash content.
It seems to be a bug with Facebook chat and Flash content.
from http://developers.facebook.com/docs/appsonfacebook/tutorial/:
If you are hosting an Adobe Flash application within Canvas, it is recommended that you set the wmode of the Flash object to "opaque":
...
Other modes (including the default mode, wmode="window", wmode="direct", and wmode="gpu") require us to hide your flash object when dialogs, popups, chat tabs, and ticker flyouts occur. This can be unpleasant or confusing for users.
From the documentation:
If you must use wmode values of window or direct, Canvas will automatically hide and display the Flash object when Dialogs, Ticket flyouts, Chat Tabs and Notifications display.
Developers who wish to provide a custom hide and display experience may pass a JavaScript function in the hideFlashCallback option for FB.init. This function will be executed whenever the Flash object is hidden or displayed due to user behavior (clicking on a Notification, etc.) and can be used by a developer to take the appropriate actions: hiding or displaying their Flash object.
FB.init({
...,
hideFlashCallback: function(params) {
if (params.state == 'opened') {
$('#some-image').show();
FB.Canvas.hideFlashElement(params.elem);
} else {
$('#some-image').hide();
FB.Canvas.showFlashElement(params.elem);
}
});

How to require fullscreen mode in a jQTouch application?

I'm using jQTouch to develop a version of a website optimized for safari on the iphone. The jQTouch demo helpfully shows how to show an "install this" message for users not using full screen mode and hide it for those who are. When in fullscreen mode, the body should have the class "fullscreen." So you can hide the "install this" message for people who have already added your app to their home page by adding this css rule to your stylesheet:
body.fullscreen #home .info {
display: none;
}
What I'd like to do is require users to use the app in fullscreen mode only. When viewed from the regular browser, they should only see a message asking them to install the app. That message should of course be hidden otherwise.
This ought to be really, really easy, so I must just be missing something obvious.
I thought one way to do this would be to simply test for the class "fullscreen" on the body: if it's not there, use goTo to get to another div, or hide the other divs, or something like that.
Strangely, however, this doesn't work. As a test, I've still got the original "info" message, as in the jQTouch demo, and it doesn't show up when I launch in fullscreen mode. So the body must have the fullscreen class. And yet I can't find any other trace of it: when I put this alert to test things after the document has loaded, I get nothing when launching in fullscreen mode:
alert($("body").attr("class"));
I also thought I might test for fullscreen mode by checking for the value of the fullScreen boolean. But this doesn't seem to work either. What am I missing? What is the best way to do this?
Well, I couldn't figure out why the standard way wasn't working, but someone on the jQTouch Google Group suggested this, which works:
if (window.navigator.standalone) {
alert ('Thanks for launching this app your home screen')
} else {
alert('Add this app to your home screen for the best experience')
}

Launching Safari in-app?

Is it possible to Launch Safari without having the app close? Just like the in-app email compose window.
I'm aware of how to display a webpage in UIWebView. I'd like to use a full web browser, i.e. Safari.
You can use a UIWebView to display web content in your app.
You can create a UIWebView with the URL to display. It will follow any links that the user touches, but that won't give you the address bar, search, navigation buttons, bookmarks or the page (tab) control. Those you'll have to add yourself, but odds are you don't want all of that. (Do you really need Google searches in your app?)
Creating a controller to manage a UIWebView and as much or as little navigation as you need is pretty easy. With a little planning, your custom controller class will also a good thing to keep in your library for the next app.
No you can not make use of the full Safari from within your own application. Your application must terminate for Safari to open.
In iPhone OS 2.0 you also had to terminate in order to send e-mails, so some chance exists that Apple couls open up Safari in the same way for iPhone OS 4.0. Make sure to request it at http://bugreport.apple.com if you are eager.
The second best option currently available is to roll your own "Browser view controller" using UIWebView. Let it have back, forward, stop/reload buttons, and an extra button for opening in Safari if the user is not content. This is how many of the greatest apps our there, like Tweetie, does it.