endTurnWithNextParticipants is not triggering notifications.

I am serialising my game state and sending it off with endTurnWithNextParticipants.

The call returns with no errors.

And if I reload the app, the game state has indeed updated. The data is reaching GameCenter and being picked up by the next player.

So far, so good.


However I would expect.

a) an immediate push notication to appear if the game is not running

b) a player (receivedTurnEventForMatch to be called if the game is running.

Neither is happening.


I have checked...

ITC - to make sure the app is marked as GameCenter enabled.

ITC - checked the bundle name etc.

Added Push Notification entitlement in XCode (although not sure whether this is required)

Checked other game center turn apps (Letterpress) with the same IDs to make sure the IDs are valid.


Any suggestions?

Replies

Hey guys,

I'm glad this is finally working for you, but it seems I have the same issues as ever.


Can you think of any setting you changed, maybe in itunes connect, before things started working again?

For me, the only weird thing is that I still have to enable sandbox mode for my GC users in order to log them in on iOS 8 devices. I don't think this is an issue as even so my old bundle id is working as expected, but can you please confirm that this is the case?

Also, which iOS versions have you tested?


Thank you!

Do you mind linking to that stackoverflow thread?

I didn't change anything. The app was compiled, sitting on my iPad and iPhone and after seeing the post here, I tried it, and it just started working.

So this strongly suggests that this was a server-side problem, and not something in my code, or the OS.


There might have been an OS update, but I don't think that was the reason.

There is no "sandbox mode" any more, so how are you enabling it?

Do you also get notifications on invites. Invite notifications does not work for me. If it works for you, I guess I might have some fault in my code or setup.

In iOS 8, under Settings > Game Center, there's a Sandbox toggle. I still have to leave it on for all unreleased app versions to work, otherwise GC login won't even be attempted. Since I only tested an iOS 9 device so far, a sandbox user was always involved in all the matches I started. Again, that doesn't prevent older bundle ids from working correctly.

As Carniphage said I already had the app compiled and just tested it again after I read that comment from stackoverflow and it was working (push notifications as well as turnbased events). So it must have been something going on server-side.


I've also tried it on two iOS 8 devices and you do indeed need to enable sandbox for them to work, but they do work.


Recently however I've not been receiving some events or push notifications on my iOS 9 device, although my friend on iOS 8 still seems to be getting most of the notifications.

This problem is driving me nuts!! Has anyone heard from Apple about this? Has anyone gotten a new app in development to send notifications for invites and completed turns? I have several older apps where the turn based notifications work as expected. But my new app in development never receives any notifications on any device running any iOS.


Thanks,

Jay

Update!


Apparently, after a TestFlight beta build is approved for external testing, the turn-based match push notifications magically start to work!!!


I hope this info saves your sanity.


Best,

Jay

Update #2. It seems that you also need to install the TestFlight app and say yes to notifications for TestFlight app for any turn based notifications to be sent with an app in development.

Update #3. Also the apps seem to need to be the same build number on all devices or the devices won't send/receive any notifications to/from each other. This seems finicky to me but perhaps there is a purpose?


--Jay

I have had the same experience. The turn based listener never gets calls when I am on a simulated device (I wish Apple would document this!), and even on real devices there are intermitent interruptions. I don't know if these "silent" periods are failures of Game Center or something getting gummed up in the OS. Bottom line: turn based games are terribly unreliable. I imagine this may be part of the impetus for the move to session based games in iOS 10.

I am experiencing exactly the same as well - receivedTurnEventForMatch never gets called. I tried the TurnBasedTester project on github and same ... Very frustrating. BTW, I am using Swift 3. Documentation is so bad and outdated. The Game Center Programming guide still points to old, depricated interfaces. https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/GameKit_Guide/ImplementingaTurn-BasedMatch/ImplementingaTurn-BasedMatch.html#//apple_ref/doc/uid/TP40008304-CH15-SW1


Please let me know if you find a work around.

Best,

Tim

Hi, I have exactly the same issue.


  • Bundle ID register to Gamecenter + Notifications
  • I'm sending a endTurnWithNextParticipants with no errors


but I do not get a :


Push Notification on the other device

nor the GKTurnBasedEventListener functions are beeing called.


Did you resolve this issue?

https://stackoverflow.com/questions/44609360/ios-turn-based-match-push-notifications-not-working-gkturnbasedeventlistener-f