Tim*_*win 6 push-notification ios onesignal
当我的应用程序位于前台时,会出现一个警告.如何在接收推送通知时阻止这种情况出现?
在你的didFinishLaunchingWithOptions方法中AppDelegate你必须添加kOSSettingsKeyInAppAlerts = NO
[OneSignal initWithLaunchOptions:launchOptions appId:ONESIGNAL_APPID handleNotificationReceived:nil handleNotificationAction:nil
settings:@{kOSSettingsKeyInAppAlerts:@NO}];
Run Code Online (Sandbox Code Playgroud)
对于Swift 3.0
// Initialize OngeSignal with Settings for Push Notifications
OneSignal.initWithLaunchOptions(launchOptions, appId: Constants.OneSignalAppID, handleNotificationReceived: nil, handleNotificationAction: {
(result) in
// Do Something with Notification Result
}, settings: [kOSSettingsKeyInFocusDisplayOption : OSNotificationDisplayType.none.rawValue])
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3905 次 |
| 最近记录: |