Prior to iOS 14.5, I adopted the following workflow for my Game Center enabled game - At the launch, if there is no authenticated GKLocalPlayer, then store the viewController passed in the completion handler and display it later to the user (i.e. not immediately after the app completes launching).
I am using the following code for the authentication process -
GKLocalPlayer.local.authenticateHandler = {viewController, error in
if (viewController != nil){
//store the viewController and present it at a later time
} else if (GKLocalPlayer.local.isAuthenticated) {
//successfully authenticated
} else {
// player could not be authenticated
}
Since iOS 14.5 the callback to the authenticationHandler seems to have changed. The login prompt is displayed automatically after app launch, if there is no authenticated player. I checked - the completionHandler is not even being called in this case before the login prompt is presented. If there is already an authenticated player on the device, then the handler is called as expected.
How can I prevent the login prompt from being displayed automatically by the system? Is there a new workflow for authenticating a player from iOS 14.5 onwards?
thanks,
Same problem. It doesn't seem like the authentication handler is being called. I get an error that I'm trying to present a view controller when there's already one being presented, which I assume is the login view controller, but I don't seem to have any way to get the login view controller on my own before the error happens.
Same problem.
Same problem here. The official documentation doesnt reflect this behaviour.