Swift 3 - localPlayer auth effects SKSpriteNode's action

54 views Asked by At

Local player auth initial banner effect my sprite node action, stuck 1-2 seconds. And then continue. What should I do for auth local player smoothly?

DispatchQueue.main.async {

        let localPlayer = GKLocalPlayer.localPlayer()

        localPlayer.authenticateHandler = {
            (view, error) in

            if view != nil {

                    self.present(view!, animated: true, completion: nil)

            }
            else {

                print("call save")
                // self.saveHighscore(5)
                print(GKLocalPlayer.localPlayer().isAuthenticated)
            }
        }
    }
1

There are 1 answers

0
Thunk On BEST ANSWER

My preference is to authenticate as early as possible in the app, as soon as the app starts, well before gameplay starts. Let it happen as soon as the app loads, and be out of the way before you load a scene or start moving nodes.