UNUserNotificationCenterDelegate willPresent 不适用于 OneSignal
UNUserNotificationCenterDelegate willPresent doesn't work with OneSignal
我正在使用 OneSignal 发送推送通知,我 运行 遇到了 iOS 10 方法 func userNotificationCenter (_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
不起作用的问题,并且 UIAlertController
出现,而不是标准的横幅。我需要做什么才能使此方法在 iOS 10 上运行并显示标准横幅?
警报现在看起来像这样
系统提示我解决此问题 here。有效。
OneSignal.initWithLaunchOptions(launchOptions, appId: appID, handleNotificationAction: { (notificationResult) in
}, settings: [kOSSettingsKeyInFocusDisplayOption : OSNotificationDisplayType.notification.rawValue])
我正在使用 OneSignal 发送推送通知,我 运行 遇到了 iOS 10 方法 func userNotificationCenter (_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
不起作用的问题,并且 UIAlertController
出现,而不是标准的横幅。我需要做什么才能使此方法在 iOS 10 上运行并显示标准横幅?
警报现在看起来像这样
系统提示我解决此问题 here。有效。
OneSignal.initWithLaunchOptions(launchOptions, appId: appID, handleNotificationAction: { (notificationResult) in
}, settings: [kOSSettingsKeyInFocusDisplayOption : OSNotificationDisplayType.notification.rawValue])