AdColony (and mediation that uses it) causes reset

Monkey Targets Forums/iOS/AdColony (and mediation that uses it) causes reset

Ferdi(Posted 2015) [#1]
In iOS, it seems AdColony SDK and Monkey does not play nicely. To fix this problem, Monkey needs to suspend when an AdColony's Ad is started, and resume when an AdColony's Ad is closed.

So when Monkey needs to show video, it needs to suspend by calling SuspendGame:

bool BBAdColony::ShowVideo()
{
	if (IsAvailable())
	{
		available = false;
		BBIosGame::IosGame()->SuspendGame();
		[AdColony playVideoAdForZone:@"vz0204a220119142dbb1" withDelegate:[[AdColonyAdDelegateGlue alloc] init]];

		return true;
	}

	return false;
}


And when the video is closed, Monkey needs to resume by calling ResumeGame:

void BBAdColony::onAdColonyAdFinishedWithInfo(AdColonyAdInfo * info)
{
	complete = info.shown;
	BBIosGame::IosGame()->ResumeGame();
}


We also need to suspend the drawView, so when Monkey suspends it does not draw.

In iosgame.cpp:

-(void)drawView:(id)sender{
	if( BBIosGame *game=BBIosGame::IosGame() ){
		if( ! game->Suspended() ){
			game->StartGame();
			game->RenderGame();
		}
	}
}


I will be asking Mark whether we can suspend drawView or not.

[Update 13 Sep 2015]
Mark said this will cause a dirty rect problem. You can either remove AdColony from Mediation or find another way to fix it.
http://www.monkey-x.com/Community/posts.php?topic=10111