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,