Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Game Center Challenges in iOS 10

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.

like image 689
claassenApps Avatar asked Jan 03 '17 20:01

claassenApps


People also ask

What happened to Game Center iOS?

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.

How do you challenge Game Center?

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.

Why did Apple get rid of Game Center?

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.

How do I access Game Center on my iPhone?

On your iPhone, iPad, or iPod touch Open Settings. Scroll to Game Center, then tap it.

What is Game Center on iOS?

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?

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.

How do you send a challenge to a friend on iOS?

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.

How do you delete friends on Game Center iOS?

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.


1 Answers

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.

like image 86
Double M Avatar answered Sep 26 '22 15:09

Double M