Game Center Invitation Handler

Hi There,


I'm having a difficult time trying to implement the Game Center invitation handling...


The link that is confusing me the most is:


https://developer.apple.com/documentation/gamekit/gkmatchmaker/1521060-invitehandler


var inviteHandler: ((GKInvite, [Any]?) -> Void)? { get set }


Is this deprecated? How are we to properly receive a GKInvite from a Game Center friend, and then act on it? I can get a list of the local players friends, and send an invite so that the banner comes up on the test device, which then launches the app...But, This where I'm stuck...what does the 'Invitee' do from there?


I'd like to autheniticate the player, and then immediately deal with the invitation when the app is launched...What am I missing?


There's alot of deprecated items in GameKit that haven't seem to updated..Could this be a sign that Apple is moving away from GC, and may no longer support it in the future?


Any help would be appreciated...Thank You.

Replies

I'm working on the same exact task. Let's keep each other in the loop.

The replacement is a protocol GKInviteEventListener that you adopt and then register it on GKLocalPlayer.local