I've implemented Game Center features like achievements and leaderboards, and now I'm working on the challenges. I was under the impression that I didn't have to add any additional code - if I had achievements or leaderboards, players would be able to send challenges to their friends. But now, in iOS10, you no longer have the ability to add players as friends - the challenges are handled through iMessages. The problem is - I don't see that feature anywhere in the GKViewController screen. If you select an achievement/leaaderboard score, you can tap on 'Challenge Friends', but it only suggests the players you already have in your friends list rather than in your contact list. Apple has also deprecated GKChallengesViewController, so I'm not sure where to look on how to do this.
Does anyone know how to add the iMessage Challenges feature to Game Center in iOS 10?
Update: I have seen that this feature lives within the GKMatchmakerViewController, but that seems to be for multiplayer type things. I'm still not sure how to use this to just send challenges.
Even though Game Center no longer exists as an app, you can manage some aspects of your Game Center account: On the iPhone Home screen, tap Settings. Select Game Center. Turn on the Game Center toggle switch.
In iOS: Go to the Settings app and select Game Center. Choose Add Friends and enter contact details to invite friends to games. On older devices: Tap the Games tab, then choose a game. On the leader board, tap a friend's name to issue a challenge.
When Apple axed the app as part of its 2016 software upate, the company turned Game Center into an optional integration service for third-party games. Unfortunately, in doing so, Apple crippled a lot of Game Center's functionality — including adding and deleting friends.
On your iPhone, iPad, or iPod touch Open Settings. Scroll to Game Center, then tap it.
Before iOS 10, Game Center was Apple's gaming-themed social network that connected through your iCloud account: It was built around a standalone app that let you add friends, challenge their high scores, and invite them to play games. It may never have been a great social network — but it was there.
What happened to Game Center in iOS 10? As part of iOS 10, Game Center evolved from stand-alone app to third-party integration — which has, unfortunately, made for a few headaches on the part of its users.
For instance, to send a challenge invitation to an existing friend, many games have no official implementation: Instead, you have to tap on their name in the leaderboards, then challenge them; once you do so, it's shared through iMessage. New iOS users may not even know Game Center exists — and thus, may never use its leaderboards or other options.
As of iOS 10, the only friends management option Game Center users have is the ability to remove all friends at once via the Settings app. As such, if you want to get rid of one person (say, an ex-boyfriend or girlfriend), you now have to delete your entire friends list — with no way of recreating it.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With