[IOS/Android] Google AdMob Extension [3.3.7][DEPRECATED]

robinschaafsma

  • *
  • Posts: 714
Disclaimer: This is a third party extension and is not officially maintained by the Stencyl Team. The AdMob support that is officially included in Stencyl only supports banner ads.

Google AdMob Extension
Works on iOS, Android

This is an new rewriten extension for Stencyl 3.3 Build 8364 and higher  that lets you use the AdMob Ad Network without a single line of code!

Whats new
- IOS: SDK 7.6.0
- Android: Use the build in SDK from Stencyl.
- Simple dropdown for Release and Test mode
- New blocks

How to download this extension
Important!!
If you already install a previous version 3.3.3 and below, you will see 2 Admob extensions under settings->Extensions because the map name is changed, follow this how to update it.
https://github.com/byrobingames/admob/blob/master/README.md#how-to-install
Now download it from GitHub:
Go to: https://github.com/byrobingames/admob
Download zip file on the right of the screen.

How to install this extension
Go to: https://github.com/byrobingames/admob/blob/master/README.md#how-to-install

Documentation and Blocks
I have write a wiki page:
https://github.com/byrobingames/admob/wiki

Error on Compiling
If you get this error go to https://github.com/byrobingames/admob/wiki/4.-Error-on-Compiling to resolve it.
Code: [Select]
[openfl] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[openfl] ld: symbol(s) not found for architecture arm64
[openfl] -[AdmobController initWithBannerID:withGravity:] in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] -[AdmobController initWithID:] in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] "kGADSimulatorID", referenced from:
[openfl] -[AdmobController initWithBannerID:withGravity:] in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] "_kGADAdSizeSmartBannerLandscape", referenced from:
[openfl] -[AdmobController initWithBannerID:withGravity:] in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] "_kGADAdSizeSmartBannerPortrait", referenced from:
[openfl] objc-class-ref in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] "_OBJC_CLASS$GADRequest", referenced from:
[openfl] objc-class-ref in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] "_OBJC_CLASS$GADInterstitial", referenced from:
[openfl] objc-class-ref in libadmobex.a(7f1c4f12_AdMobEx.o)
[openfl] "_OBJC_CLASS$_GADBannerView", referenced from:

Version History
- 3.3.0 - (2015-05-21): Rebuild version of old extension.
- 3.3.1 - (2015-05-23): re-zip extension. minor adjustment on IOS callbacks.
- 3.3.2 - (2015-06-08): Update IOS SDK to 7.3.1.
- 3.3.3 - (2015-06-13): Update info.txt file
- 3.3.4 - (2015-07-31): Update IOS SDK to 7.4.0
- 3.3.5 - (2015-08-21): Update IOS SDK to 7.4.1
- 3.3.6 - (2015-11-07): Update IOS SDK to 7.5.2
- 3.3.7 - (2015-11-07): Update IOS SDK to 7.6.0

Give a donation if you like this extension. :D


« Last Edit: September 25, 2016, 11:23:39 am by robinschaafsma »

robinschaafsma

  • *
  • Posts: 714

« Last Edit: May 22, 2015, 02:17:12 am by robinschaafsma »

ErLuiSS

  • Posts: 125
As always nice job! you work so hard on stencyl extensions.. really thanks!

Wasanni

  • *
  • Posts: 136
Nice! I have a question about this though. I installed it and tried to compile for iOS but after adding this extension it will not compile and I am getting errors. I tried doing this:

"Admob will now require you to copy GoogleMobileAds.a from your Stencylworks folder > engine-extensions > admob > ndll > iPhone.
You need to copy that file and past it in stencylworks folder > games-generated > game name > export > ios > game name > lib > arm7 AND arm64"

I moved the files but it still gives me the same errors and does not compile. Is this a common issue or is it just me ? I just added the extension and used the initialize block with the app id.



This is what I see in the log viewer so I thought moving the files would work.


   stencyl.sw.util.StreamGobbler   [openfl] ** BUILD FAILED **
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048585004314   stencyl.sw.util.StreamGobbler   [openfl] clang: error: linker command failed with exit code 1 (use -v to see invocation)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048585004313   stencyl.sw.util.StreamGobbler   [openfl] ld: symbol(s) not found for architecture arm64
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004312   stencyl.sw.util.StreamGobbler   [openfl]       -[AdmobController initWithBannerID:withGravity:] in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004311   stencyl.sw.util.StreamGobbler   [openfl]       -[AdmobController initWithID:] in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004310   stencyl.sw.util.StreamGobbler   [openfl]   "_kGADSimulatorID", referenced from:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004309   stencyl.sw.util.StreamGobbler   [openfl]       -[AdmobController initWithBannerID:withGravity:] in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004308   stencyl.sw.util.StreamGobbler   [openfl]   "_kGADAdSizeSmartBannerLandscape", referenced from:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004307   stencyl.sw.util.StreamGobbler   [openfl]       -[AdmobController initWithBannerID:withGravity:] in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004306   stencyl.sw.util.StreamGobbler   [openfl]   "_kGADAdSizeSmartBannerPortrait", referenced from:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004305   stencyl.sw.util.StreamGobbler   [openfl]       objc-class-ref in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004304   stencyl.sw.util.StreamGobbler   [openfl]   "_OBJC_CLASS_$_GADRequest", referenced from:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004303   stencyl.sw.util.StreamGobbler   [openfl]       objc-class-ref in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004302   stencyl.sw.util.StreamGobbler   [openfl]   "_OBJC_CLASS_$_GADInterstitial", referenced from:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048584004301   stencyl.sw.util.StreamGobbler   [openfl]       objc-class-ref in libadmobex.a(7f1c4f12_AdMobEx.o)
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048583004300   stencyl.sw.util.StreamGobbler   [openfl]   "_OBJC_CLASS_$_GADBannerView", referenced from:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048583004299   stencyl.sw.util.StreamGobbler   [openfl] Undefined symbols for architecture arm64:
jar:file:/Applications/Stencyl-full%20(1)/sw.jar!/res/logview4j/images/info.gif   false   INFO   1432332048583004298   stencyl.sw.util.StreamGobbler   [openfl] ld: warning: ignoring file /Users/Ryan/stencylworks/engine-

robinschaafsma

  • *
  • Posts: 714
You don't have to move any files., that file isn't even exsist any more.

And  i can't see any errors on you log. Try to do the following;

-Delete admob extension folder from engine-extension folder.
-unzip the new version of admob in the engine-extension folder.
- Open Stencyl and RUN CLEAN project first.
-Now try if you can build your game.

Max Finch

  • *
  • Posts: 2174

Getting a compile error :/


Logs attached


======


This looks to be the case:


Code: [Select]
2015-05-22 23:19:43,876 INFO  [Thread-23] stencyl.sw.util.StreamGobbler: [openfl] ld: warning: ignoring file /Users/maxglockling/stencylworks/engine-extensions/admob/frameworks/GoogleMobileAds.framework/GoogleMobileAds, file was built for unsupported file format ( 0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x73 0x2F 0x43 0x75 0x72 0x72 0x65 0x6E 0x74 ) which is not the architecture being linked (arm64): /Users/maxglockling/stencylworks/engine-extensions/admob/frameworks/GoogleMobileAds.framework/GoogleMobileAds

Max Finch

  • *
  • Posts: 2174
Okay so it looks like somehow the .framework file gets corrupted either during the download or .zip stage.

To fix this compiling issue you must download the original ios files from here: http://dl.google.com/googleadmobadssdk/googlemobileadssdkios.zip

Then extract the .framework and paste it into you stencylworks directory > engine-extensions > admob > frameworks > paste.

« Last Edit: May 23, 2015, 12:50:01 pm by Max Glockling »

Max Finch

  • *
  • Posts: 2174
Just a request that would be really helpful during runtime, I'm noticing issues using the interstitial is loaded block and was wondering if you could combine loaded and failed to load into one?

Something like this if that makes sense:

Code: [Select]
/// Called when an interstitial ad request succeeded.
- (void)interstitialDidReceiveAd:(GADInterstitial *)ad
{
   
    interstitialLoaded = YES;
    NSLog(@"interstitialDidReceiveAd");
}

/// Called when an interstitial ad request failed.
- (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error
{
    interstitialLoaded = NO;

and

Code: [Select]

   bool interstitialLoaded()
    {
        if(adController != NULL)
        {
            /*
            if (adController.interstitialLoaded)
            {
               
                adController.interstitialLoaded = NO;
                return true;
               
               
            }
             */
            return adController.interstitialLoaded;
        }
        return false;
    }


EDIT:


Or better yet instead of changing the booleans when the function is called change them when the actual status is called like this:


Code: [Select]
/// Called when an interstitial ad request succeeded.
- (void)interstitialDidReceiveAd:(GADInterstitial *)ad
{
   
    interstitialLoaded = YES;
    interstitialFailToLoad = NO;
    NSLog(@"interstitialDidReceiveAd");
}


/// Called when an interstitial ad request failed.
- (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error
{
    interstitialLoaded = NO;
    interstitialFailToLoad = YES;
    NSLog(@"interstitialDidFailToReceiveAdWithError: %@", [error localizedDescription]);
}

robinschaafsma

  • *
  • Posts: 714
Okay so it looks like somehow the .framework file gets corrupted either during the download or .zip stage.

To fix this compiling issue you must download the original ios files from here: http://dl.google.com/googleadmobadssdk/googlemobileadssdkios.zip

Then extract the .framework and paste it into you stencylworks directory > engine-extensions > admob > frameworks > paste.

Mmm Ok, i gonna look if i can re-zip.

robinschaafsma

  • *
  • Posts: 714
Just a request that would be really helpful during runtime, I'm noticing issues using the interstitial is loaded block and was wondering if you could combine loaded and failed to load into one?

- You can donwload version 3.3.1 with you request. It was a minor adjustment.

I just wondering, what issues you  where noticing...


« Last Edit: May 23, 2015, 02:57:39 am by robinschaafsma »

luismp

  • Posts: 219
Hi, i'm curious about this new version of the admob extension. I have the previous admob extension in all my android games and it was performing well until january, now i have ecpms below 0.6 $ (for interstitials) , ...yeah pretty low xD. I know that admob now is integrated in google play services and im wondering if those low ecpms are caused by using an old admob version, does this new version of admob improve in some way the bad performance a lot of android developers were having recently or is totally unrelated?

robinschaafsma

  • *
  • Posts: 714
Hi, i'm curious about this new version of the admob extension. I have the previous admob extension in all my android games and it was performing well until january, now i have ecpms below 0.6 $ (for interstitials) , ...yeah pretty low xD. I know that admob now is integrated in google play services and im wondering if those low ecpms are caused by using an old admob version, does this new version of admob improve in some way the bad performance a lot of android developers were having recently or is totally unrelated?

Actually i don't know. I don't think so, but give it a try...

Max Finch

  • *
  • Posts: 2174
Along with Chartboost there seems to be something causing memory leaks and crashes with this extension.

NeoCHI

  • Posts: 523
Along with Chartboost there seems to be something causing memory leaks and crashes with this extension.

Anyone looking into this? I'm hoping to use both in my new game.

luismp

  • Posts: 219
what do we have to put in the block show interstitial with interval time.....?? what numbers should i put in that block??