IOS 9 Game Center programmatic friend invitation issue

I created a game that uses real-time multiplayer programmatically. It was originally targeted to towards IOS 8 devices. Recently after migration to IOS 9, Game Center has caused a lot of problems. The main issue I cannot resolve is Inviting a friend in multiplayer (for testing).

After the recent turn off of SANDBOX only auto match works but not friend invite. The invitation doesnt get recieved on the other end.


What I currently know:

  • This is a game center issue because I have tested the issue on a different app from scratch. Which caused the exact same problem
  • I am using accounts that are registered as internal testers on iTunes connect Testflight
  • IOS 8 has merged sandbox with production
  • When I send invites it doesn't get received on other device
  • Notification are turned on both devices and Push Notifications are enabled for the app
  • Restarting devices didn't resolve anything. I have tested on IOS 8.x and IOS 9.0.x

I had exactly the same issue two days ago. Before it everything was running perfectly. I could send and receive invitations and handle them in my App. I did not upgrade to IOS 9 as well. However I faced the same problem. Is there any improvement in your situation. Appreceiate very much if anyone facing the same problem inform us.

thanks.

I tested with iOS 9.1 too, invites are not working, or very rarely, (i.e. yesterday I was able to send invites between two devices today it is impossible

I am having this problem too. I can no longer send programmatic invites to GameCenter friends. I am getting this error when trying to invite a GameCenter friend of the user:


Error creating match: Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo={GKServerStatusCode=5096, NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server., NSUnderlyingError=0x1610eff80 {Error Domain=GKServerErrorDomain Code=5096 "[Peer device (type: iPad) does not support a game compatible with: unknown:<myBundleID>:1.0.0:100, Peer device (type: iPhone) does not support a game compatible with: unknown:<myBundleID>:1.0.0:100]" UserInfo={GKServerStatusCode=5096, NSLocalizedFailureReason=[Peer device (type: iPad) does not support a game compatible with: unknown:<myBundleID>:1.0.0:100, Peer device (type: iPhone) does not support a game compatible with: unknown:<myBundleID>:1.0.0:100]}}}


This is with a development build. According to Apple's recent technical note here:


https://developer.apple.com/library/ios/technotes/tn2417/_index.html


The compatibility matrix should be disregarded for development builds. This doesn't seem to currently be the case.


This seems to be a recent server-side Game Center issue.


Can anyone get programmatic invitations to work for GameCenter in development? It would be helpful to hear more stories. I suggest everyone file bug reports.

Anyone having any luck with this?

I confirm same issue.


In particular, testing with the very same App on different devices:

- on iOS7 invitation is successfully sent and everything works;

- on iOS9 the invitation is "sent" (findMatchForRequest returns completionHandler with no error) but never received


Using GKMatchmakerViewController (sending invites with the default UI) works under iOS9.

Guess the best workaround for the moment will be to drop custom UI and switch back to default UI provided with GKMatchmakerViewController, which is not that simple in my case.

Forgot to mention:

- problem affects my Live Apps which were working well on iOS<9

- tried to update code using the new "recipients" (and "recipientResponseHandler") instead of "playersToInvite" and I get the same behaviour on iOS9 (can't test on iOS7 since it's not supported there).

- tested also 3rd party games on the store implementing custom UI for friend invitation and found same issue.

I guess this is the same or at least a similar problem.


When I execute the code below the recipient sometimes gets a popup "Invite" badge at the top of the screen, but player:receivedTurnEventForMatch:didBecomeActive:

is never called. See also my two comments about what lines are reached.


         GKMatchRequest *matchRequest = [[GKMatchRequest alloc] init];
          matchRequest.defaultNumberOfPlayers = 2;
          matchRequest.recipients = @[player];
          matchRequest.inviteMessage = INVITE_MESSAGE;
          matchRequest.recipientResponseHandler =
          ^(GKPlayer *gkPlayer, GKInviteRecipientResponse response)
          {
            NSLog(@"GK invite response: %d", (int)response); // This line is never reached
          };
     
          [GKTurnBasedMatch findMatchForRequest:matchRequest
                          withCompletionHandler:
           ^(GKTurnBasedMatch *match, NSError *error)
           {
             if ((error == nil) && (match != nil))
             { //This line is reached. No problems...
// A bit down I end the turn


Apart from the missing notification everything is fine. When I load the matches on the receiving side the match gets loaded. I will add a bug report now.


Two questions/concerns:

  • I guess that the player:receivedTurnEventForMatch:didBecomeActive: method is the method that shall be called in the receivers device upon an invite?
  • I don't want any notification badge on top of the screen in the first place. I mean, I don't get any "Your turn" badge every time it's someones turn. Why do I get an "Invite" badge? Is it possible to disable it?

Just want to add that it would be great if some Apple person could verify that this is because of some issue in the Game Center functionality. Is there any known issue with invites not triggering the player:receivedTurnEventForMatch:didBecomeActive: method?


It would also be great to know if anyone gets invite notifications?

Same problem for me.


I am actually in development, every thing work well, leaderboard, achievement, auto match making.


But when i try to invite friends with GKMatchmakerViewController, i get this error.


{Error Domain=GKServerErrorDomain Code=5096 "Peer device (type: iPhone) does not support a game compatible with: unknown:BUDLE_ID:1.0:10"


Any help please ?

I had a similar problem on iOs 9 only (iOS6,7,8 are fine). By calling of "findMatchForRequest:withCompletionHandler:" a GKTurnBasedMatch was indeed created, but the participant list was ignored and a random game was created (= only first participant set, others nil).


In my case I changed just one line:

request.playersToInvite = playersAsNSString; //deprecated in iOS 8.0


to:

request.recipients = playersAsGKPlayer; //new in iOS 8.0


and "findMatchForRequest:withCompletionHandler:" works correctly for iOS 9.1 now.

I also am encountering the "operation couldn’t be completed. Peer device (type: iPad) does not support a game compatible with: unknown:com.xxxx.xxxxx:1.0:1.0" error while trying to set up a custom real-time match.

Using the GKMatchmakerViewController does work for me.

Looking in my console logs, I did see this error related to my app:

Application(com.xxx.xxxxx) is not allowed to run in production

At first, I didn't think much of that since I knew I was running in the GameCenter Sandbox.

However, reading these posts (and having just read thetech note regarding iOS 9, I'm beginning to wonder if this is part of the issue.


If there's no GameCenter sandbox, then how do development versions of apps get authorized to log on to production?


I also just logged a bug with Apple for this issue-

Does anyone have an update on this?

I logged a bug with Apple, and it's been marked as a duplicate, but there's no update as to whether this issue is being worked.

All that I've read is that Apple is aware of this issue 😟


I would like to continue with my current in-development app, but it really requires a custom match (real-time). I only want to allow matches with friends since it will utilize in-game voice chat.


If I can't get any clarity when this issue will be resolved, I may have to look at alternate SDK's.

I also had problems where real-time game invites sent programmatically from iOS9 devices were not working despite my implementation working fine on iOS8.


Like Siarsky, I also found that updating my implementation to use the up-to-date GKPlayer based API instead of the deprecated NSString functionality fixed the problem for me.


Although unlike Siarsky, I am using real-time not turn-based matchmaking.


Also, for me, it was far from the one-line change that Siarsky experienced. Updating all the deprecated GameCenter matchmaking involved touching a fair amount of code and included switching from inviteHandler to GKLocalPlayerListener, using loadFriendPlayersWithCompletionHandler instead of loadPlayersForIdentifiers as well as switching my GKMatchRequest from playersToInvite/inviteeResponseHandler to recipients/recipientResponseHandler.

Interesting.. I found posts recommending the use of GKLocalPlayerListener and I did implement those methods.

Currently I have one singleton class which implements most of the handlers and delegates for deprecated and newer GameCenter classes.


I also am trying a real-time match.

Yours is the first case I've read (after a lot of research) where someone has related how actual code has solved this issue.

Thanks for sharing your solution!


I'll revisit my code and see what I find-

I've had plenty of other game code to write so I've been focused on that and relying on auto-matching for now but the custom invite is a must in my case.


-10 points to Apple for not relaying the solution to this issue. I logged a bug and all they did was close it as a duplicate 😠


Fingers are crossed-

Any chance you guys could post bug numbers?

Hi Amanda,

I really appreciate your posts in this forum. Thank you so much!


I've got all kinds of strange problems with turn based matches. To mention a few:

- Turn notifications are received on one device, but not on the other. And suddenly it just starts to work.

- Since some weeks a won match is not reported as ended. And suddenly, after 10 minutes, it is.

- It's has been all kinds of other various problems during the development of my game.


I'm concerned about one thing. Don't YOU have ANY problems with turn based matches in your regression tests? Because I guess that you must have a quite large test setup to assure the quality of Game Center. I guess that you need to run all kinds of supported devices with all supported iOS versions constantly. 24/7 you need have those (15?) latest devices to play RANDOM fake turn based matches to assure that everything plays together. You must play 10 000 matches a day, and MAYBE it's ok that ONE of those games fail in some way. Those matches shall be played with:

- random data length in each turn

- random delays between each "step"

- etc


It takes less than one week to build such a test setup. Can I trust that you have such a setup?


If I invest one or two hours of my time to write a bug report, can I trust that you have made your part in trying to secure your framework? I mean, it takes too long time with bug reporting. It takes one month before someone starts with the investigation. You need to write the bug reports yourself, in an informal way. 10 minutes after your latest commit you will see that 10 out of 100 matches has failed, and you can correct the bug immediately.


I also think that it would be great if you could publish your test setup, to show what a working Game Center application should look like. That would be a great enhancement to the documentation. I'm currently only supporting 9.2 devices, as I want to reduce incompatibility issues, but still I've got problems. Of cause the problems might be in my code, I can't know that, but it would be great with some kind of statement that Game Center turn based matches works flawlessly for 99% of the apps, and that it hardly ever fails in your extensive regression tests.


BTW, during development I'm playing with two game center id:s owned by myself. Can that lead to problems?


I don't know if you can see my email in any way. If you can, feel free to send me a mail. I really don't need to discuss this in public. I will of cause respect your privacy.


Thanks,

Fredrik

IOS 9 Game Center programmatic friend invitation issue
 
 
Q