GKMatchDelegate inviteDelegate?

[Match] cannot set connecting state for players: (
"..."
), as there is no inviteDelegate set yet. The state might directly change to Ready when we set the inviteDelegate later and call sendQueuedStatesAndPackets.

We are setting the match.delegate to our implementation of GKMatchDelegate and GKMatchmakerViewControllerDelegate.

It also prints a warning later: [Developer] <Warning>: need to implement one of the following methods in GKMatchDelegate: match:didReceiveData:forRecipient:fromRemotePlayer:, match:didReceiveData:fromRemotePlayer:

However we are certainly implementing that func:

public func match(_ match: GKMatch, didReceive data: Data, forRecipient recipient: GKPlayer, fromRemotePlayer player: GKPlayer) {
print("Data received from player...");
}

Any ideas?
Hi. I ran into the same problem. Did you happen to find the solution? Thanks!
@devon-redgames, igorland

I get this error too on occasion. I do not yet know the cause.

I believe the delegate that the error message is referring to is actually the listener on the GKLocalPlayer instance. See the protocol for GKInviteEventListener here: https://developer.apple.com/documentation/gamekit/gklocalplayerlistener?language=objc

There does not appear to be a delegate that handles invites on the GKMatch object at all.
After some testing, it seems that this error message is logged even when the match is connected successfully. If your match is not starting, I don't think this error has anything to do with ti.
I tend to receive this error when a player accepts an invitation, this acceptance is passed to the inviting player, however the player who accepted it fails matchmaking with an error. As a result, the inviting player starts a match without the invited player. I followed up with the Apple's technical support and with their help, rewrote the following method:

Code Block
func player(_ player: GKPlayer, didAccept invite: GKInvite) {
// Accepting invitation from an already open GKMatchmakerViewController
        if matchmakerViewController != nil {
            matchmakerViewController!.dismiss(animated: false, completion: nil)
            self.matchmakerViewController!.matchmakerDelegate = nil
            self.matchmakerViewController = nil
        }
// Giving the system time to do a full "clean-up" of matchmakerViewController before starting new task
        let delayTime = DispatchTime.now() + .milliseconds(2000)
// Initiating matchmaking VC on the main thread after the delay
        DispatchQueue.main.asyncAfter(deadline: delayTime) {
            self.matchmakerViewController = GKMatchmakerViewController(invite: invite)
            self.matchmakerViewController!.matchmakerDelegate = self
            self.delegate?.presentMatchmaking(viewController: self.matchmakerViewController!)
        }
}


I am testing it now and will report if successful. If this helps solve your issues, please let me know.

Cheers.
GKMatchDelegate inviteDelegate?
 
 
Q