GKTurnBasedMatchViewController not bringing up Messages Invite. Works sometimes, fails often

I am working on the turned-based match app Wordiamo. It is networked through Game Center. I am having a problem inviting new players through the GKTurnBasedMatchmakerViewController. I deploy it with:


let request = GKMatchRequest()

request.minPlayers = 2

request.maxPlayers = 2

let mmvc = GKTurnBasedMatchmakerViewController(matchRequest: request)

mmvc.turnBasedMatchmakerDelegate = self

mmvc.showExistingMatches = false

self.delegate = delegate

self.presentingViewController.present(mmvc, animated: true, completion: block)


After launching the view controller, when I press Invite Friends, sometimes it works fine (maybe 30-50% of the time), bringing up a Messages invitation. But many other times it returns the following error:


Error Domain=ExtensionErrorDomain Code=-5900 "(null)": The operation couldn’t be completed. (ExtensionErrorDomain error -5900.)

2017-11-13 17:53:10.616581-0800 Wordiamo[7733:1484145] viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}


Any thoughts as what could be causing this failure that only happens some of the time? Thanks.

Replies

This is a bug that started in iOS 11. I filed a bug report many weeks ago. No response from Apple yet. In my app, after pressing "Invite Friends", the "Multiplayer Game" window will crash pretty often. If you keep trying, it eventually works.

In my experience, this bug was around since the beginning of iOS10. I kept on hoping it would go away but it didn't. It would be great if we could bring up the Messages invite programmatically.