Search Unity

Prime31 Tapjoy, AdMob and AdWhirl Plugins now available!

Discussion in 'iOS and tvOS' started by prime31, Feb 3, 2011.

  1. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Prime,

    I have iAds and the Admob plugin but have some trouble getting them working together.
    How can I check with an if statment if iads has shown or did not shown so that I can start up admob if iads fails.

    Can I check with an external script if an iad has shown?

    I have some little js nowhow but not c#.

    Thanks in advance!
    Roy
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @darkness, all of our plugins fire events to let you know what is happening. iAd fires these events: http://cl.ly/FjA8 and AdMob fires these: http://cl.ly/Fi4m Those event should provode more than enough information for what you need to do.
     
  3. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi prime,

    is this the one that tells me that an ad has shown or not?

    // Fired when the adView is either shown or hidden
    public static event AdManagerEventHandler adViewDidChange;
     
  4. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @darkness, that is correct.
     
  5. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Prime,

    Sorry for my stupidness ;)

    There is fireHideShowEvents check box in the inspector. Is this simulating a failed ad? If that is true I did this.

    In AdAdapter.cs there is a piece of code like below:

    I put the AdMobBinding.createBanner in there and when I checked the fireHideShowEvents checker and run the game.
    Now I see iAds and AdMob, when unchecked I only see iAds. So i'm thinking I coming somewhere :)

    Code (csharp):
    1. void adViewDidChange( bool adDidShow )
    2. {
    3.     Debug.Log( "Ad is visible? " +  adDidShow );
    4.     AdMobBinding.createBanner( AdMobBannerType.iPad_728x90, 0, 934 );  
    5. }
    I have no idea if this is somewhat correct ^^

    If an iAd failed to show it runs admob but when an iAd is available again it must destroy admob and show that iAd again.
    Maybe I have to buy Adwhirl too but can it show iPad size banner?

    Roy
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dark, when the adViewDidChange method is called it will return true or false. If true destroy the AdMob banner. If false, create the AdMob banner.
     
  7. EricD

    EricD

    Joined:
    Sep 7, 2011
    Posts:
    128
    I'm just installed the mopub plugins in my 3.5 project in which I also use the latest social plugin storekit. Now I can't get my game to run on idevices. The game crashes after the splashscreen and I get this error from the debug log:

    "Loading /var/mobile/Applications/BCF920CB-4E83-4184-A339-5FD5C8E4CD81/ichi.app/Data/Managed/P31RestKit.dll into Unity Child Domain
    Failed to load AOT module '/var/mobile/Applications/BCF920CB-4E83-4184-A339-5FD5C8E4CD81/ichi.app/Data/Managed/P31RestKit.dll.dylib' in aot-only mode.
    Failed to wait on a semaphore (errno:37)


    (Filename: ./Runtime/Threads/Semaphore.h Line: 137)

    Failed to wait on a semaphore (errno:15)"

    If I uninstall the mopub plugins the game runs fine.
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eric, first off open a bug with Unity. That appears to be an issue on their end with regard to script compilation. I am trying to repro on my end with no luck so far but I only have one device with me at the moment so I will test more shortly.
     
  9. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Prime,

    I have it working, it is now showing iAd and if iAd fails to deliver admob takes over till there is an iAd again.

    Awesome!

    Roy
     
  10. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
    Hi! I used to use the following code (added to AdwhirlBinding) to control if I wanted to turn ads on/off in certain parts of the game:

    however after upgrading to the latest version it seems to no longer have any effect and ads appear whenevs

    EDIT: Okay seems I have do this at the Start() of new scenes as it seems to reset or something between scenes
     
    Last edited: Apr 12, 2012
  11. EricD

    EricD

    Joined:
    Sep 7, 2011
    Posts:
    128
    I can send you our project. So you can try that out.

    We can't really wait for Unity to fix it since they don't update that often. We need a solution really fast.
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eric, feel free to send it over but there really isn't much we can do to affect Unitys script compilation besides opening a bug report with them. I take it you have tried doing a Build and Replace to get a fresh build and rule out that it is just a one off issue?
     
  13. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Anyone had a similar experience? Still haven't been able to get this to work. Even posted on the AdWhirl forum and they don't seem to have any ideas.

    Note: an AdWhirl test query (i.e. http://mob.adwhirl.com/getInfo.php?appid=xxx&appver=250) returns all the correct information. It SHOULD be working, but it just doesn't.
     
  14. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Figured something out re my problem above.

    On the app that works: when I build it in Unity, I get two post processing "events" - (1) "AdWhirl Unity support successfully integrated!", and (2) "AdWhirlAdMob Unity support successfully integrated!".

    On the app that doesn't show AdMob ads, I only get "AdWhirl Unity support successfully integrated!" when building it.

    Why would that be the case?


    NOTE: Using the exact same code in both apps to create the Ad banners, and also using the same version of the AdWhirl plugin.

    NOTE: I noticed giza's problem above which sounds the same as mine. Ran a chmod 777 on PostprocessBuildPlayer* but it hasn't made a difference.
     
    Last edited: Apr 16, 2012
  15. EricD

    EricD

    Joined:
    Sep 7, 2011
    Posts:
    128
    Hi,

    I'm using mopub plugin in a universal iOS app. However when I select a ipad banner on the mopub website it also shows up on the iphone version. How do i make a specific banner for iPhone one for iPad?
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gappetto, did you use the prime31 menu item to enable AdMob on the 2nd project?


    @eric, you can setup different ad units in the MoPub web portal then just use the appropriate unit for each platform.
     
  17. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Yes - have checked that it's definitely enabled.
     
  18. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @geppeto, I would suggest deleting the plugin files and reimporting a fresh download of the plugin. If you have any odd file permission issues that will clear them up.
     
  19. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Not happening unfortunately. I deleted the AdWhirl folder under Plugins and all the AdWhirl stuff under Editor. Reimported the package (it prompts that it's going to Set Permissions on the project folder). I then disabled and then enabled AdMob under the Prime31 menu (just in case). Then built the project, and it still doesn't include the AdMob integration.
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @geppeto, can you send over the contents of the plugin logs (open Console.app, select "All Messages" and filter for "prime31")?
     
  21. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    http://www.geppetto-games.com/temp/prime31.log

    There should be "good" and "bad" ones there. I've just built a new version of the game in which the plugin is working, so that's the more recent records.
     
  22. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    That "--- About to kick off the Runner for AdWhirlAdMob ---" line for example, only appears once in the file. There's three builds in there - the first two are the "bad" app, and the last one is the "good" app.
     
  23. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @geppeto, there are no errors at all in there. You can try deleting the AdWhirlAdMob postprocessbuildplayer script which might then trigger it in its normal fashion.
     
  24. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    No good :(

    It's totally bizarre. It just DOES NOT want to work in this app.

    Can I just manually add the AdWhirlAdMob folder to the XCode project? Or is there some other "linking" of some sort happening there?
     
    Last edited: Apr 17, 2012
  25. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @gappetto, you can certainly manually add the files for this project. Dragging and dropping them into your project *should* be all that it takes.
     
  26. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Will try that once I'm home and update with the result. I'm connecting remotely at the moment and can't build onto a device from here.
     
  27. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Works fine adding it manually. We'll just call it one of those weird things and leave it at that :)

    Long as I can get this update out I'm happy. It will probably work fine in the next app.
     
  28. EricD

    EricD

    Joined:
    Sep 7, 2011
    Posts:
    128
    I'm using mopub plugin on iOS. But if I enable admob my app crashes when it loads a admob ad. If I disable admob from the mopub website it works fine.
     
  29. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eric, are you including the AdMob SDK in your project? What is the stack trace of the crash?
     
  30. EricD

    EricD

    Joined:
    Sep 7, 2011
    Posts:
    128
    Here it is:
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @eric, that looks like it is coming from deep within the Mopub SDK. You wil need to open a bug report with the Mopub crew to get some info on what may be happening.
     
  32. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Prime,

    I have an issue with the admob plugin. Installed your latest version. When an admob banner is showing and I tap on the banner it is showing the add but when I tap done to go back to the game, the game crashes. In Xcode I get an cresh message like below. I have no clue what it could be.

    Thanks in advance!,


    Roy


     
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @darkness, can you provide a stack trace? That screenshot doesn't provide much insight on what it could be.
     
  34. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Primem,

    I have no idea what stack trance is but maybe this is it :)

    Code (csharp):
    1.  
    2. 2012-05-07 17:15:07.734 CoinPusherGoldFree[14258:707] -[AdMobManager setBannerPosition]: unrecognized selector sent to instance 0x1809980
    3. 2012-05-07 17:15:07.736 CoinPusherGoldFree[14258:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AdMobManager setBannerPosition]: unrecognized selector sent to instance 0x1809980'
    4. *** First throw call stack:
    5. (0x35c6088f 0x315d9259 0x35c63a9b 0x35c62915 0x35bbd650 0x34a47933 0x35c34a33 0x35c34699 0x35c3326f 0x35bb64a5 0x35bb636d 0x35935439 0x30791e7d 0xaebc 0x7908)
    6. terminate called throwing an exception(lldb)
    7.  
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @Darkness, aha! Found and fixed the bug. Grab the latest unitypackage to get the fix.
     
  36. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Awesome, problem is solved!

    As always great support! 5stars
     
  37. tiktakgames

    tiktakgames

    Joined:
    Jun 27, 2011
    Posts:
    15
    Hi Mike, i added your plugin adwhirl, im only added admob and iad, iad ad 100% .

    Im receibing this error:

    Cannot create ad network config from {
    key = "xx";
    nid = yyy;
    nname = admob;
    priority = 2;
    type = 1;
    weight = 0;
    }: Ad network type

    I tried to add the admob sdk, but is the same that you have in the amdob folder. THanks
     
  38. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @tik, check your email. I already responded there.
     
  39. tiktakgames

    tiktakgames

    Joined:
    Jun 27, 2011
    Posts:
    15
    oks, thanks, i need define the size of the ad of admob with adwhirl, how to set this? because i need the size of 480x32 the same of iads, and getme more big. thanks
     
  40. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @tiktak, I answered you via email already. Please post support requests in only one location in the future.
     
  41. laserlars

    laserlars

    Joined:
    Nov 17, 2011
    Posts:
    255
    Just bought this, great plugin as always!
    But I got a question though:

    I´ve set up iAd and Admob through the Adwhirl portal, and ads from both are now showing.
    Do I have to worry about the

    public static void setAdMobPublisherId( string publisherId )
    and
    public static void registerAppDownloadWithiTunesAppId( string iTunesAppId )
    ?

    Sorry, but I really don´t know what these do.
    Thank you.
     
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @laser, as long as you are getting ads you are good to go. No need to worry about the other methods.
     
  43. Atul Prakash

    Atul Prakash

    Joined:
    Mar 20, 2012
    Posts:
    31
    Hi,

    I have purchased Adwhirl Unity Plugin from Prime31. I have also gone through its document pages i.e. http://prime31.com/unity/docs/#adwhirlDoc but when I import the package AdWhirlAdMobInterstitialBinding.cs is missing. Can anybody has idea of this?

    Rgds
     
  44. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @atul, please do not spam us. We received 4 emails from you and now a forum post. Your emails have already been answered.
     
  45. devGuillaume

    devGuillaume

    Joined:
    Feb 10, 2012
    Posts:
    23
    Do you have any news about this?
    We're trying to integrate their plugin and anyone having a hard time doing it can add their voice to this thread:
    https://groups.google.com/group/tap...12d77256e85/9ce3e9b1e0e2a5b6#9ce3e9b1e0e2a5b6
    Let's hope we can have a Prime31 Android Tapjoy plugin as soon as possible! :)
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @dev, unfortunately there is no news to report on that front at this time.
     
  47. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Hi Prime 31,

    I have the mopub plugins running well on both ipad2 and 3GS, unfortunately I do not success to make it work on ipod2 and 4GS...

    Is there a know reason it could be the cause of this problem?

    When I request the banner on 4GS and ipod2 I get the following message :

    Code (csharp):
    1. Jul 19 13:44:39 unknown myAppName[25173] <Warning>: MOPUB: Ad manager (0x99a6060) fired initial ad request.
    2.  
    I have no idea if this message is a good news or should be worst :D
     
    Last edited: Jul 19, 2012
  48. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sama, there is no reason that I am aware of that the device type would have. It appears that the ad request is being sent. The MoPub SDK usually logs the response as well so you may want to watch the logs and keep an eye out for it.
     
  49. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734
    Alright just found out a 300pixel value set to Y position will move the banner to 600 pixel on 4G device.

    Then if you require a Size728x90px banner, to move it at the bottom of the screen :

    Screen.height will - 90 = 640 - 90 = 550px.

    But if I set the position to 550, this will move the banner to 1100 pixel height...


    Now if if I set the position to Screen.height / 2 - 45 I will approximately get the banner at the bottom screen on 4st gen device (iphone 4GS and ipod2).


    As I said ipad2 and 3GS work the normal way, no need to trick.



    Well I have no idea why.
     
  50. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    @sama, iOS uses points not pixels. Every iOS device that is not an iPad is 480x320 points in size. Every iPad is 1024x768 points.