Hello,
How should i pause a game when game center displays some notification?
example:- In mid game, if i ( press home button -> go to game center -> log out of current account -> get back into the game again using the home button) a notification pops to create or use an existing account.
I tried using [[CCDirector sharedDirector] pause] in the authenticateLocalPlayer method, right before calling authenticateWithCompletionHandler method, but doesn't seem to work.
Here's my code:
-(void) authenticateLocalPlayer
{
GKLocalPlayer* localplayer = [GKLocalPlayer localPlayer];
if (localplayer.authenticated == NO)
{
[[CCDirector sharedDirector] pause];
[localplayer authenticateWithCompletionHandler:^(NSError* error)
{
lasterror = error;
[[CCDirector sharedDirector] resume];
}];
}
}
Is there anyway to know if any notification (or anything) pops up?