Search Unity

iAd unity 1.7

Discussion in 'iOS and tvOS' started by SoundGuy32, Sep 11, 2010.

  1. SoundGuy32

    SoundGuy32

    Joined:
    Oct 30, 2009
    Posts:
    17
    Hey,

    i'm trying to put iAd into my unity 1.7 basic game
    all my forum searches yeild that there's a plug in for unity 3, but i want to get iad running on my game in the curent stable release of 1.7.

    i'm trying to follow the instructions in the iAd programming guide by apple and i don't really understand objc and whats' goign on enough to do it.
    there's something about attaching it to a view
    when i try to put the code in the AppController :

    [code
    ]ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
    adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
    [self.view addSubview:adView];
    [/code]

    i get a compile error:
    2.6.1/Classes/../../Assets/Editor/OpenFeint/Xcode/AppController+OpenFeint.mm:658: error: request for member 'view' in 'self', which is of non-class type 'AppController*'

    can anyone help? does anyone have a running code for 1.7 basic that they can share?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    OF + the plugin won't work hand in hand because both override the load handling of the application with a category.

    Depending on which plugin you got, you can do something about it or not (one of them is as static library where you cant' do anything about it. an unhappy overkill the dev did there, static library for something thats meant to be used with other systems specially as it is a $4 system)
     
  3. SoundGuy32

    SoundGuy32

    Joined:
    Oct 30, 2009
    Posts:
    17
    i said i didn't use any plug ins, first - plug ins don't work with unity 1.7 basic.
    i don't know of any 1.7 plug ins, i just saw that unity 3 plug in.
    i'm asking if anyone did it , so they can share the code, or method of doing it for the good of all of us iphone devs who want iads.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Ah sorry missread that as that you use that plugin (the one I'm talking about works in a way that works with basic and pro, which is why it collides with OF and alike)


    The code you post there is not enough to get anything done cause you have no view by default on which you operate to hook that in.
    also its not as trivial, as you otherwise might end in the position where unity does not even get any touches anymore.


    you can look at how openfeint does it for example and use a similar approach with a dummy view controller you add which overlays only the part of your screen where the iad button is for example.
     
  5. SoundGuy32

    SoundGuy32

    Joined:
    Oct 30, 2009
    Posts:
    17
    honestly, i don't know the first thing about xcode and obj or building a view.
    i vaguely understood what you said, but i have no idea how to code it, appreciate the help if anyone can provide it, like how to add a view and turn it on on a call like openfeint does it from the appcontroller.