2017-03-24 24 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]) 
相關問題