diff --git a/src/ios/OAuthPlugin.swift b/src/ios/OAuthPlugin.swift index 049d765..927f1c3 100644 --- a/src/ios/OAuthPlugin.swift +++ b/src/ios/OAuthPlugin.swift @@ -32,7 +32,9 @@ class ASWebAuthenticationSessionOAuthSessionProvider : OAuthSessionProvider { var delegate : AnyObject? required init(_ endpoint : URL, callbackScheme : String) { - self.aswas = ASWebAuthenticationSession(url: endpoint, callbackURLScheme: callbackScheme, completionHandler: { (callBack:URL?, error:Error?) in + let url: URL = URL(string: callbackScheme)! + let callbackURLScheme: String = url.scheme ?? callbackScheme + self.aswas = ASWebAuthenticationSession(url: endpoint, callbackURLScheme: callbackURLScheme, completionHandler: { (callBack:URL?, error:Error?) in if let incomingUrl = callBack { NotificationCenter.default.post(name: NSNotification.Name.CDVPluginHandleOpenURL, object: incomingUrl) }