iOS Game Center GKTurnBasedMatchmakerViewController - works sometimes, fails others

146 Views Asked by At

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.

0

There are 0 best solutions below