|
@@ -42,11 +42,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
|
|
|
|
- func application(_: UIApplication, open url: URL, options _: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
|
|
|
|
|
+ func application(_: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
|
// gets here when app returns from oAuth2-Setup process - the url contains the provided token
|
|
// gets here when app returns from oAuth2-Setup process - the url contains the provided token
|
|
if let params = url.queryParameters, let token = params["code"] {
|
|
if let params = url.queryParameters, let token = params["code"] {
|
|
NotificationCenter.default.post(name: NSNotification.Name("oauthLoginApproved"), object: nil, userInfo: ["token": token])
|
|
NotificationCenter.default.post(name: NSNotification.Name("oauthLoginApproved"), object: nil, userInfo: ["token": token])
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // Hack to format url properly
|
|
|
|
+ let urlString = url.absoluteString
|
|
|
|
+ .replacingOccurrences(of: "openpgp4fpr", with: "OPENPGP4FPR", options: .literal, range: nil)
|
|
|
|
+ .replacingOccurrences(of: "%23", with: "#", options: .literal, range: nil)
|
|
|
|
+
|
|
|
|
+ self.appCoordinator.handleQRCode(urlString)
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
|