Skip to content

Instantly share code, notes, and snippets.

@andyzinsser
andyzinsser / client.m
Last active September 28, 2018 23:19
Full flow of authenticating a Game Center Player on a third party server.
// request Game Center verification data for localPlayer from apple
- (void)authenticateGameCenterPlayer:(GKLocalPlayer *)localPlayer
{
[localPlayer generateIdentityVerificationSignatureWithCompletionHandler:^(NSURL *publicKeyUrl, NSData *signature, NSData *salt, uint64_t timestamp, NSError *error) {
if (error) {
NSLog(@"ERROR: %@", error);
}
else {
// package data to be sent to server for verification
NSDictionary *params = @{@"publicKeyUrl": publicKeyUrl,