Hi there, i've some problem with game kit. All work fine, the olny problem is the changement of user logged. I want to know when the user signout or change account in gamecenter when my app is running. I've use the next code for this kind of notification but it don't work
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver: self selector:@selector(authenticationChanged) name:GKPlayerAuthenticationDidChangeNotificationName object:nil];
I do not receive any notification, this cose in into view did load!
Any ideas?? Please Help ME!!
I've tryed to create a new project only whit gamecenter sign in and notification but the problem it's not solved :(
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(authenticationChanged) name:GKPlayerAuthenticationDidChangeNotificationName object:nil];
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {NSLog(@"SDADA %@",error);}];
NSLog(@"%@",[[GKLocalPlayer localPlayer]alias]);
}
-(void)authenticationChanged
{
NSLog(@"ooo");
}
what i forgot??