Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

I need help with iAds trying to implement iAds in my sprite kit game i read through the apple docs still not working

I need help putting iAds in my sprite kit game. I read through the apple docs on iAds and still not working out for me. I read through all your community answers and there are no real answers here just go here and there please help.

// GameViewController.m

import "GameViewController.h"

import "TitleScene.h"

import "iAd/iAd.h"

@implementation GameViewController

(void)viewDidLayoutSubviews { ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];

adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;

[self.view addSubview:adView];
// GameViewController.h // Space Cat //

// Copyright (c) 2016 George Gutieres. All rights reserved. //

import <UIKit/UIKit.h>

import <SpriteKit/SpriteKit.h>

import <iAd/iAd.h>

@interface GameViewController : UIViewController <ADBannerViewDelegate>

@end

Hi George,

Can you post your code? I haven't used iAds before, but I might be able to figure it out.

1 Answer

Hello I think iAd is about to be discontinued in June, the 30th. Maybe you should look for another ad provider for your app or game.