-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
the plugin works well up to auth process after auth the SFSafariViewController stays in the spotify redirect page does not
dismiss the SFSafariViewController.
var observer: NSObjectProtocol?
observer = NotificationCenter.default.addObserver(
forName: NSNotification.Name.CDVPluginHandleOpenURL,
object: nil,
queue: nil
) { note in
let url = note.object as! URL
guard url.absoluteString.contains("code") else { return }
svc.presentingViewController!.dismiss(animated: true, completion: nil)
NotificationCenter.default.removeObserver(observer!)
self.currentNsObserver = nil
self.currentCommand = nil
let res = CDVPluginResult(
status: CDVCommandStatus_OK,
messageAs: [
"code": url["code"]
]
)
self.commandDelegate.send(res, callbackId: command.callbackId)
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels