Game Center Challenges in iOS 10 Game Center Challenges in iOS 10 ios ios

Game Center Challenges in iOS 10


From the Apple Docs:

Issuing a challenge does not display a user interface to the player issuing the challenge; this is code you need to implement yourself.

There are also a few examples on how to issue challenges and how to find players you can invite, such as:

- (void) challengePlayersToCompleteAchievement: (GKAchievement*) achievement{    [achievement selectChallengeablePlayers:[GKLocalPlayer localPlayer].friends withCompletionHandler:^(NSArray *challengeablePlayerI, NSError *error) {        if (challengeablePlayers)        {            [self presentChallengeWithPreselectedPlayers: challengeablePlayers];        }    }];}

...or:

- (void) challengeLesserMortalsForScore: (int64_t) playerScore inLeaderboard: (NSString*) leaderboard{    GKLeaderboard *query = [[GKLeaderboard alloc] init];    query.leaderboardIdentifier = leaderboard;    query.playerScope = GKLeaderboardPlayerScopeFriendsOnly;    query.range = NSMakeRange(1,100);    [query loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) {        NSPredicate *filter = [NSPredicate predicateWithFormat:@"value < %qi",playerScore];        NSArray *lesserScores = [scores filteredArrayUsingPredicate:filter];        [self presentChallengeWithPreselectedScores: lesserScores];    }];}

By the looks of it you still can only invite players that are already part of game center, i.e. no arbitrary "contacts" from the contact list (which makes sense), but this is only an assumption.