2017-03-24 21 views
1

我正在使用OneSignal发送推送通知,我遇到了问题,在iOS 10上,方法func userNotificationCenter (_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)不起作用,并且出现UIAlertController,而不是标准横幅。我需要做什么才能使此方法在iOS 10上运行并显示标准横幅?UNUserNotificationCenterDelegate willPresent不适用于OneSignal

警报看起来像现在这样 enter image description here

回答

1

我被提示来解决这个问题here。有用。

OneSignal.initWithLaunchOptions(launchOptions, appId: appID, handleNotificationAction: { (notificationResult) in 

     }, settings: [kOSSettingsKeyInFocusDisplayOption : OSNotificationDisplayType.notification.rawValue]) 
相关问题