Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

iAd Plugin for Unity

Discussion in 'iOS and tvOS' started by jonaphin, Jul 8, 2010.

  1. mikolo

    mikolo

    Joined:
    Nov 27, 2009
    Posts:
    249
     
  2. jonaphin

    jonaphin

    Joined:
    Dec 31, 2008
    Posts:
    209
    It depends on this line (and obviously the code you write).
    Technically, this line should point to an interpreter that exists in your system.
     
  3. mikolo

    mikolo

    Joined:
    Nov 27, 2009
    Posts:
    249
    Hi Jonaphin,

    i become following ERROR, I dont know..is it from iAd Integration? Do you know what it meens?:

    PHP:
    ERROR,Time,311853822.044,Function,"void CLClientHandleRegistrationTimerExpiry(__CFRunLoopTimer*, void*)",Registration timer expiredbut client is still registering!

    and also a warning sometimes, this is from iAd:

    PHP:
    Ad Loading ErrorError Domain=ADErrorDomain Code="no qualified ads found for this request" UserInfo=0xa83cf00 {NSLocalizedDescription=no qualified ads found for this request}
    can i recognize this, because the next time there is a banner available?


    and also this when terminate the app:

    PHP:
    2010-11-19 11:22:11.805 baby-ninja[7681:ad27] *** attempt to pop an unknown autorelease pool (0x149fc00)
    2010-11-19 11:22:11.806 baby-ninja[7681:ad27] *** attempt to pop an unknown autorelease pool (0x14b2a00)
    can i also recognize this, because it at the termination of app?


    and also:
    PHP:
    The view controller <ADRemoteViewController0xa8668d0returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientationsIt should support at least one orientation
    what can i do there?


    thanks for reply
     
    Last edited: Nov 19, 2010
  4. polsen

    polsen

    Joined:
    Nov 2, 2010
    Posts:
    11
    I have got your iAd plugin working fine on both iPhone and iPad but there is 1 small problem on iPad. The iAd (test) shows only 75% of it on the screen, the other 25% is off screen. Is there a reason for this or can I change the actual pixel position? I realise there is a position function (which I have not tried yet) but by the looks of it, it only places the advert at the Top and Bottom without actually specifying the pixel position?

    On another note, does anyone have the code to check if a flip screen or rotate screen has occurred and then set the position of the iAd appropriately ... I could probably look around and find some info to write it but if someone has done it then why not be lazy :)
     
  5. haggis

    haggis

    Joined:
    Mar 5, 2010
    Posts:
    91
    I'm getting a similar problem on the iPad if not the same. When I set the ad to the bottom I can only see part of the ad. If I set the ad to the top, the ad is centered about a third of the way up the screen (Only tried landscape so far).

    For rotation I use the following which works well for the iPhone:

    Code (csharp):
    1. function Update () {
    2.    if (iPhoneInput.orientation == iPhoneOrientation.LandscapeLeft) {
    3.     iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeRight);
    4.    }
    5.    
    6.    if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) {
    7.     iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeLeft);
    8.    }
    On the iPad unfortunately the ad is rotating but going off centre and half off the screen to the right.
     
  6. haggis

    haggis

    Joined:
    Mar 5, 2010
    Posts:
    91
    @Polsen
    Apologies..... For Unity3 the following script for rotating to landscape works for me:

    Code (csharp):
    1. function Update () {
    2.    if (Input.deviceOrientation == DeviceOrientation.LandscapeLeft) {
    3.     iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeRight);
    4.    }
    5.    
    6.    if (Input.deviceOrientation == DeviceOrientation.LandscapeRight) {
    7.     iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeLeft);
    8.    }
    9. }
     
  7. mikolo

    mikolo

    Joined:
    Nov 27, 2009
    Posts:
    249
    Hi polson,

    please tell how do it work on iPad?

    thanks?
     
  8. zinks

    zinks

    Joined:
    Jun 17, 2006
    Posts:
    84
    Is this plugin still being supported?
     
  9. jonaphin

    jonaphin

    Joined:
    Dec 31, 2008
    Posts:
    209
    Hi Zinks,

    Not at the moment. Can't wait to get back though.
     
  10. LeoNgai

    LeoNgai

    Joined:
    Jan 27, 2010
    Posts:
    26
    Hello Jonaphin,

    Your iAd plug-in works great on Unity iPhone 1.7 and I am a very happy user!

    However, now I am looking to release some iPad Unity applications by using your iAd plug-in. Thus, I have some questions for you:

    1) My current environment is XCode SDK is 4.2 + Unity 3, which version iAd plug-in should I use? If so, how to get the updated version? (I only have very old version in July on hand, which works well only for Unity iPhone 1.7.)

    2) I tried to use the July version iAd ad-in with Unity 3 + XCode SDK 4.2 but after the application is run on my iPad device, I am not able to see any iAd testing banners. (Setting target OS as iOS 4.2. I examined my XCode SDK 4.2 projects, I noticed that iAd.Framework, CoreGraphics.Framework, and iAd.h are all missing and showing red color. Did I miss anything? Cheers!)

    Regards,
    Leo
     
  11. polsen

    polsen

    Joined:
    Nov 2, 2010
    Posts:
    11
    Could someone please advise the correct way to use this plugin for iPad. I have tried every which way to get the iAds lined up correctly.


    I start with:
    iAd4Unity.ShowBannerWithPosition(iAd4Unity.BannerPosition.Top);


    Then I have tried both suggestions for rotation code but with no success:

    function Update ()
    {
    if (Input.deviceOrientation == DeviceOrientation.LandscapeLeft)
    {
    iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeRight);
    }

    if (Input.deviceOrientation == DeviceOrientation.LandscapeRight)
    {
    iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeLeft);
    }
    }

    *********
    OR
    *********

    function Update ()
    {
    if (iPhoneInput.orientation == iPhoneOrientation.LandscapeLeft)
    {
    iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeRight);
    }

    if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight)
    {
    iAd4Unity.RotateTo(iAd4Unity.UIOrientation.LandscapeLeft);
    }
    }


    Below are the images that show the iAds plugin problem I'm having for the iPad rotation / positioning.



     
  12. jonaphin

    jonaphin

    Joined:
    Dec 31, 2008
    Posts:
    209
    Hi Polsen,

    It isn't going to work with the current version. The iAd plugin was designed for the iPod Touch / iPhone.

    I do not have an iPad-compatible version planned for the time being.
     
  13. moscosherman

    moscosherman

    Joined:
    Sep 17, 2009
    Posts:
    20
    is there going to be an update for sdk 4.3???
     
  14. samshosho

    samshosho

    Joined:
    Apr 12, 2010
    Posts:
    370
    I have the latest version of the plugin (1.7.1), but it will not do the postprocessing, so the project does not get patched, thus nothing happens when the project in then built to the device.
    I tried using the previous version, 1.5 (i don't have the updates in between), which does actually the postprocessing just fine, and then i added the latest version on top of it. Things went fine and the project is patched, but then xcode gives an error !
    //////
    ld: library not found for -liad4unity
    collect2: ld returned 1 exit status
    Command /Xcode3.2.5/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
    /////
    So i don't know what to do, i have done a clean build and replace, and have done several Append, but no luck.

    Any help would be appreciated.
     
  15. petero181

    petero181

    Joined:
    Feb 23, 2011
    Posts:
    104
    how to buy iAd plugin?
     
  16. jpatinop80

    jpatinop80

    Joined:
    Jul 29, 2012
    Posts:
    55
    Hi, I saw in your site there is not selling anymore, but I need it... could you sell it again?
     
  17. jonaphin

    jonaphin

    Joined:
    Dec 31, 2008
    Posts:
    209