Question

How can i place a UIView on top of the Chartboost ad? I tried everything. I am using the Chartboost delegate to know when an ad is displayed and then I add the UILabel but it will just get dimmed out by the Chartboost ad. I even tried the method [self.view bringSubviewToFront:label]; but it did not work. Anyone knows a workaround so I can display this label without it getting dimmed out by the Chartboost interstitial.

This is the code I use for the ad (The timer was just for testing):

-(BOOL)shouldDisplayInterstitial:(NSString *)location {

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, -150 /2, 500, 300)];
label.textColor = [UIColor whiteColor];
label.text = @"Tap ad to get a boost";
label.font = [UIFont fontWithName:@"AvenirNext-DemiBold" size:32.6];
label.alpha = 1;

[self runAction:[SKAction waitForDuration:5] completion:^{

    self.view.window.rootViewController.view = label;
}];


return YES; }
Was it helpful?

Solution

While this may be possible, it's viewed as artificially inflating (or incentivizing) clicks. These types of things are scanned for & regularly shut down.

Instead, use a number of interstitial locations in your app. Test which locations work best & at what frequency and focus your efforts there.

Full disclosure: I work at Chartboost.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top