我正在处理我原来的 webview 中的 LunchUrl 但问题是当我把
kOSSettingsKeyInAppLaunchURL
[ true] 它在我原来的 webview 上打开新的 webview
[ false] 它在 safary 中打开链接
let notificationOpenedBlock: OSHandleNotificationActionBlock = { result in
let payload = result?.notification.payload
if let additionalData = result!.notification.payload!.additionalData {
// DEEP LINK and open url in RedViewController
centerViewController.receivedURL = payload!.launchURL as! String!
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = centerViewController
self.window?.makeKeyAndVisible()
}
}
OneSignal.initWithLaunchOptions(launchOptions, appId: "*****", handleNotificationReceived: { (notification) in
}, handleNotificationAction: notificationOpenedBlock , settings: [kOSSettingsKeyAutoPrompt : true, kOSSettingsKeyInFocusDisplayOption : OSNotificationDisplayType.notification.rawValue, kOSSettingsKeyInAppLaunchURL: true])
Run Code Online (Sandbox Code Playgroud)