Skip to content

Commit

Permalink
Fixes iOS crash
Browse files Browse the repository at this point in the history
Co-Authored-By: Manuele Sarfatti <[email protected]>
  • Loading branch information
2 people authored and dpogue committed Mar 27, 2022
1 parent 06b3ecd commit 26e82c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ios/OAuthPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 26e82c5

Please sign in to comment.