Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full example for Interstitial android #33

Open
fadaytak opened this issue Mar 24, 2015 · 13 comments
Open

full example for Interstitial android #33

fadaytak opened this issue Mar 24, 2015 · 13 comments

Comments

@fadaytak
Copy link

hi

have you a full sample for supporting android Interstitial???

this one doesn't work

var adMobInterstitial = admob.createView({
publisherId:"ca-app-pub-924XXXXXXXXXXXXXXXXXXXXXXXXXX2",
testing:false, // default is false
//top: 10, //optional
//left: 0, // optional
//right: 0, // optional
bottom: 2, // optional
adBackgroundColor:"#eff0f0", // optional
backgroundColorTop: "#eff0f0", //optional - Gradient background color at top
borderColor: "#000000", // optional - Border color
textColor: "#000000", // optional - Text color
urlColor: "#00FF00", // optional - URL color
linkColor: "#0000FF", //optional -  Link text color
adUnitId : 'ca-app-pub-924XXXXXXXXXXXXXXXXXXXXXXXXXX2', // You can get your own at http: //www.admob.com/
isInterstitial : true
//primaryTextColor: "blue", // deprecated -- now maps to textColor
//secondaryTextColor: "green" // deprecated -- now maps to linkColor
});

//listener for adReceived
adMobInterstitial.addEventListener(admob.AD_RECEIVED,function(){
// alert("ad received");
Ti.API.info("adMobInterstitial - ad received");
});

//listener for adNotReceived
adMobInterstitial.addEventListener(admob.AD_NOT_RECEIVED,function(){
//alert("ad not received");
 Ti.API.info("adMobInterstitial - ad not received");
});

$.windowRoot.add(adMobInterstitial);

$.windowRoot.open();

and the result is :

Ads: Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
Ads: CsiReporterFactory: CSI is not enabled. No CSI reporter created.
Ads: No fill from ad server.
dalvikvm: Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.s.g.<init>
dalvikvm: VFY: unable to resolve virtual method 3153: Landroid/webkit/WebSettings;.setMixedContentMode (I)V
Ads: Failed to load ad: 3
@bcaufield
Copy link

The error message is referring to the need for a theme in the ad activity
like this:

<activity

                android:configChanges=

"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"

                android:name="com.google.android.gms.ads.AdActivity"

                android:screenOrientation="portrait" android:theme=

"@android:style/Theme.Translucent"/>

This should be added to the tiapp.xml file in the
android/manifest/application section.

Let me know if you need more information.

Brian Caufield

On Tue, Mar 24, 2015 at 7:11 PM, fadaytak [email protected] wrote:

hi

have you a full sample for supporting android Interstitial???

this one doesn't work

var adMobInterstitial = admob.createView({
publisherId:"ca-app-pub-924XXXXXXXXXXXXXXXXXXXXXXXXXX2",
testing:false, // default is false
//top: 10, //optional
//left: 0, // optional
//right: 0, // optional
bottom: 2, // optional
adBackgroundColor:"#eff0f0", // optional
backgroundColorTop: "#eff0f0", //optional - Gradient background color at top
borderColor: "#000000", // optional - Border color
textColor: "#000000", // optional - Text color
urlColor: "#00FF00", // optional - URL color
linkColor: "#0000FF", //optional - Link text color
adUnitId : 'ca-app-pub-924XXXXXXXXXXXXXXXXXXXXXXXXXX2', // You can get your own at http: //www.admob.com/
isInterstitial : true
//primaryTextColor: "blue", // deprecated -- now maps to textColor
//secondaryTextColor: "green" // deprecated -- now maps to linkColor
});

//listener for adReceived
adMobInterstitial.addEventListener(admob.AD_RECEIVED,function(){
// alert("ad received");Ti.API.info("adMobInterstitial - ad received");
});

//listener for adNotReceived
adMobInterstitial.addEventListener(admob.AD_NOT_RECEIVED,function(){
//alert("ad not received");
Ti.API.info("adMobInterstitial - ad not received");
});

$.windowRoot.add(adMobInterstitial);

$.windowRoot.open();

and the result is :

Ads: Please set theme of AdActivity to @android:style/Theme.Translucent to enable transparent background interstitial ad.
Ads: CsiReporterFactory: CSI is not enabled. No CSI reporter created.
Ads: No fill from ad server.
dalvikvm: Could not find method android.webkit.WebSettings.setMixedContentMode, referenced from method com.google.android.gms.ads.internal.s.g.
dalvikvm: VFY: unable to resolve virtual method 3153: Landroid/webkit/WebSettings;.setMixedContentMode (I)V
Ads: Failed to load ad: 3


Reply to this email directly or view it on GitHub
#33.

@fadaytak
Copy link
Author

thank you for your response

shoud i use a specific version of module?

in the release section, we have more than one version

https://github.com/appcelerator-modules/ti.admob/releases

cordially

@bcaufield
Copy link

You are usually best using the latest version but you have to test to see
if it supports the features you are looking for.

Personally on android, I gave up on ti.admob and went with
https://github.com/ndizazzo/android-parse-titanium-module, he also has
support for Smart Banners which are needed to support android's many device
sizes, particularly 7" tablets. There is a working example of an
interstitial ad too, which is always a plus.

On Wed, Mar 25, 2015 at 7:50 AM, fadaytak [email protected] wrote:

thank you for your response

shoud i use a specific version of module?

in the release section, we have more than one version

https://github.com/appcelerator-modules/ti.admob/releases

cordially


Reply to this email directly or view it on GitHub
#33 (comment)
.

@elberto
Copy link

elberto commented Mar 25, 2015

From my side the didreceivead event is strange. You have to show ad to get it to trigger. Resulting you must show an empty window, getting all the main app to not respond if not ad is received. I did manage to get something with a little work.Also I didn't manage to get your fork to display interstititial with ios8. For the time being, I only use banner ads. Was working fine with ios7.
Regards

@fadaytak
Copy link
Author

with this

<activity android:configChanges= "keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" android:screenOrientation="portrait" android:theme= "@android:style/Theme.Translucent"/>

there is no error message, thank you... but there is no ads

and i have new one

[ERROR] :  GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

i have an error message of google play services

any idea?

cordially

@bcaufield
Copy link

I never got interstitials working properly with this module either, in my
branch I added some of the function calls for interstitials but I gave up
when I found the AdMob Pro module in the marketplace:
https://marketplace.appcelerator.com/apps/5670
This one just works.

On Wed, Mar 25, 2015 at 7:10 PM, fadaytak [email protected] wrote:

with this

there is no error message, thank you... but there is no ads

and i have new one

[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

i have an error message of google play services

any idea?

cordially


Reply to this email directly or view it on GitHub
#33 (comment)
.

@bcaufield
Copy link

Oh, and you can safely ignore the Google play services not found error - I
believe it is a known issue and doesn't affect the ad functionality.

On Thu, Mar 26, 2015 at 9:21 AM, Brian Caufield [email protected] wrote:

I never got interstitials working properly with this module either, in my
branch I added some of the function calls for interstitials but I gave up
when I found the AdMob Pro module in the marketplace:
https://marketplace.appcelerator.com/apps/5670
This one just works.

On Wed, Mar 25, 2015 at 7:10 PM, fadaytak [email protected]
wrote:

with this

there is no error message, thank you... but there is no ads

and i have new one

[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

i have an error message of google play services

any idea?

cordially


Reply to this email directly or view it on GitHub
#33 (comment)
.

@michelmelo
Copy link

I'm having the same problem. I can not activate the interstitial android.

@bitk0der
Copy link

bitk0der commented May 6, 2015

I've made some changes to source code of ti.admob module and got worked interstitial ads properly and added support for smart banner. The main thing, is that module dont have support of interstitial ads in the version on GitHub.
Oh, and other issue is - be carefull of using that version, its not destroying admob view properly and after closing your app still running and trying to get ads, check the logs after closing app.

@mitulbhalia
Copy link

@bcaufield you said on your 25th march comment that https://github.com/ndizazzo/android-parse-titanium-module has a working example of an
interstitial ad too, which is always a plus but I am not able to find it. Can you please share a link if you have?

@fcjurado
Copy link

I wish to display an interstitial, but when I use the code, only a normal banner is displayed on bottom. Anybody has same issue? I did'n open another issue due it's related to this one.

Using this module (v2.1.5 from https://github.com/appcelerator-modules/ti.admob/releases/tag/android-2.1.5) and the code in #33 (comment).

@tvfoodmaps
Copy link

A bit confused, are there versions of this (or any) module that display interstitial ads for either/both iOS and Android?

@deckameron
Copy link

Did anyone manage to get this working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants