OAuth2
OAuth2 copied to clipboard
Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
I created a simple proof-of-concept app (Swift 4.1 and p2_OAuth2 version 4.0.1 using a Google OAuth client.
When I tap the Login button, it opens Safari and takes me to Google for authentication. I login correctly. Then it reopens my app, but I immediately get this error in my AppDelegate:
Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
I don't see any stack trace in the console so I don't know how to debug it further.
Help appreciated! Mark
I'm having the same problem! I would appreciate any help as well!
I just found an answer that worked for me!
I had to add this function in the appDelegate to handle the url:
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
OauthManager.oauth2.handleRedirectURL(url)
return true
}
@JacobAhlberg thanks that worked for me too! I had this method, which worked fine up until XCode 9.3 and iOS 11.3:
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
}
Thanks for your help. Mark
Can confirm @JacobAhlberg fix works!