How to Load Ad After Certain Time Interval in you App – iOS XCode

If you would like to load an Ad after certain time interval in your App, for eg. 30 seconds after App Launch. You can use the following code to do so –

Put the code inside of your AppDelegate.m applicationDidBecomeActive –

1
[NSTimer scheduledTimerWithTimeInterval:30.0 target:self selector:@selector(fun) userInfo:nil repeats:NO];

Put this code anywhere in the same file and put the Ad code inside it –

1
2
3
-(void)fun {
// Ad Code
}

The NSTimer object above will call the “fun” function after the specified time interval and your Ad will get load up.

Namit Gupta

iOS Developer @GetVokal. Passionate about Mobile Apps. Loves to Design. You can reach him on his social profiles below.

Leave a Reply