I have integrated RevMobAds in my app. How can I check whether a RevMob session has started or not?
In the AppDelegate :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[RevMobAds startSessionWithAppID:@"My RevMob AppID"];
return YES;
}
-(void)showAds
{
banner = [[RevMobAds session] banner]; //banner is an object of RevMobBanner
banner.delegate = self;
[banner showAd];
}
In my first ViewController :
-(void)displayAd
{
STAppDelegate *appDelegate = (STAppDelegate *)[UIApplication sharedApplication].delegate;
[appDelegate showAds];
}
When I call the displayAd function in the viewDidLoad of the first page, some warnings are displayed:-
WARNING: SESSION NOT STARTED!! UNEXPECT BEHAVIOUR CAN OCCOUR!!
WARNING: USING ADS WITHOUT STARTING A SESSION COULD PRODUCE UNPREDICTED BEHAVIOUR!
Also the ad is not displayed. But when I call the displayAd function after a delay,say 5sec, then everything works well and the ad is displayed, but the problem is that this time interval of 5 secs may vary from time to time. So, can anyone suggest me a way to find out whether the RevMob session has started or not so that I can call the displayAd function only after that?