【发布时间】:2018-07-27 04:55:23
【问题描述】:
我正在处理我原来的 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])
【问题讨论】:
-
嗨,你解决了吗?
-
如果您不想使用默认的 OS Web 视图,请不要在通知中设置
url字段。相反,您可以使用附加数据字段并在其中放置一个自定义 URL 字段。
标签: ios swift push-notification uiwebview onesignal