Created
March 20, 2017 04:13
-
-
Save Majirefy/eb65d99cb7e7dba7ae1eaf99f870ca53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GKLocalPlayer localPlayer = GKLocalPlayer.localPlayer(); | |
localPlayer.setAuthenticateHandler(new GKLocalPlayer.Block_setAuthenticateHandler() { | |
@Override | |
public void call_setAuthenticateHandler(UIViewController viewController, NSError nsError) { | |
if (viewController != null) { | |
iosApplication.getUIWindow().rootViewController().showDetailViewControllerSender(viewController, null); | |
} else if (localPlayer.isAuthenticated()) { | |
localPlayer.generateIdentityVerificationSignatureWithCompletionHandler( | |
new GKLocalPlayer.Block_generateIdentityVerificationSignatureWithCompletionHandler() { | |
@Override | |
public void call_generateIdentityVerificationSignatureWithCompletionHandler( | |
NSURL publicKeyUrl, NSData signature, NSData salt, long timestamp, NSError error) { | |
//successfully logged into gamecenter | |
} | |
}); | |
} else { | |
//canceled by the user or GameCenter is disabled | |
//display alert view | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment