how to authorise OAuth2 in tvOS

239 views Asked by At

app going to unknown state and doesn't do anything i'm having this code in didFinishLaunchingWithOptions for P2Auth2 and can't authorise

    Authenticator.sharedInstance.oauth2 = OAuth2
    Authenticator.sharedInstance.reauthorizeSilently(callback: { (wasFailure, error) -> Void in
                if (!wasFailure) {
                    print("Re-Auth Successfull")

                } else {
                    print("Re-Auth failed")
                }
            })
    return true
1

There are 1 answers

0
adonoho On

As tvOS does not support web views, it seems unlikely that you will be able to directly log in from AppleTV. Most AppleTV solutions that succeed use a second device to acquire the OAuth login token. If you can authenticate directly without using OAuth2, I recommend that you do so.