Getting iAds working in 2.1

I was missing the ‘showAdFromTop()’ in my set up in main

I just need to switch the code now to be landscape banner, as its a portrait banner size currently in landscape mode (a little short)

Thanks for all your help. Just got the new version off to the store!

It’s mad how quickly I forgot all the different stages, even the basic one that triggered the banner. Last game update was in july!

@majormorgan Did you figure out how to get the iAds to work in landscape? I tried with my first app and iAds was displaying portrait ads in landscape, so I’ve just been making my apps portrait only since then.

I have a few app ideas that require landscape that I haven’t made because of it.

Hey, I think it automatically scales later. Have to wait and see if it gets approved :wink:

Also did you mean that you store approved app had portrait ads in landscape when it went live?

No, all my Codea made apps are portrait only, mainly because the landscape ads weren’t working right in testing.

I’ll let you know if and when this update gets approved wether the ads are working properly in landscape despite the testing being incorrect

@Majormorgan, iAds always start in portrait, so if you start in landscape they are incorrect, but if you rotate to portrait and back they will be correct. There used to be a solution to this but iOS 7 deprecated it and I’m not sure what the correct fix is nowadays.

Thanks @JakAttak

I remember with my last portrait version of the game the ads weren’t quite right in the preview but in the final they worked just fine so fingers crossed. Bit peeved with the app store, its been 9 days waiting for approval and it hasn’t even budged from ‘waiting for review’ yet…

Damn, the game update is now live and it hasn’t worked properly. The ads live are unstable compared to the ad test mode.

All ads stay the size of portrait mode but in horizontal orientation making them taller than they should be especially on iPhone 6.

Some ads that link directly to a page trigger the ad to freeze the game and not come out of non ad clicked mode. Others that expand, expand in portrait mode and you close them and then they behave properly landscape at the right size.

Need to get a handle on a fix for landscape so I can put in a revised version asap. Anyone have any ideas what to change in the ad code to make it work please? Lua I’m cool with, Objective C is another beast…

I’m thinking I’ll change the following code from @Simeon 's 2.1 update in the iAds:

        //  Initialise our iAd Banner View
        CGRect frame = CGRectZero;
        
        _bannerView = [[ADBannerView alloc] initWithFrame: frame];
        [_bannerView setAutoresizingMask: UIViewAutoresizingFlexibleWidth];
        
        _bannerView.delegate = self;

to:

ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
[self.view addSubview:adView];

I’ve not got my code engine here at work so I’ll have to wait til I get home tonight to test.

that code didn’t work as the AdBannerContentSizeIdentifierLandscape is depreciated…

I’ve asked apple to help as all their tutorials on iAds show the landscape mode code to be depreciated now but don’t show what to do for iOS8

Argghhhhh…

Easier to just make games in portrait only. I gave up long ago.

Lol, I can’t I just spent two months making my game work in landscape mode as everyone said it needed to play in landscape mode instead of portrait…

Charge $0.99 for it and move on. Unless it’s a really popular game, you’re better off making another game instead continuing to update a game that isn’t making much money.

yeah you’re right. I’ll do that. Ads are like flogging a dead horse. A royal pain in the bee-hiney…

I wonder, can I change the price of a free game to $0.99 ( i only expect the new customers will pay it if it does).

Yes you can, but I believe you need to submit a new build.

The iAds add-on works great in portrait only games, it is just buggy for landscape.

Need a lot of downloads to make money with iAds.

@Crumble, @majormorgan, I totally agree. I have two games with ads, one paid ($.099) and despite having far less sales the paid app has made me about 100 times more money in less time.

I’ve already submitted the new one and set it as £0.79 ($0.99). Also as I had two bugs, one of which @Simeon has helped me to overcome, I’ve asked for an expedited approval. We’ll see if they approve it quick. Thanks for all your help and advice @Crumble , @JakAttak and @Simeon