如何在收到推送通知并且应用程序在swift中关闭时禁用警报?

时间:2017-02-12 12:31:21

标签: swift push-notification onesignal

当我的应用程序打开并且收到推送通知时,警报会被禁用但是当应用程序关闭时显示警报

OneSignal.initWithLaunchOptions(launchOptions,
                                appId: "appid",
                                handleNotificationReceived:{ (notification) in

     let payload: OSNotificationPayload? = notification?.payload              
     let fullMessage: String? = payload?.body
     print("Recived no" + fullMessage!)
     print("Received Notification - \(notification?.payload.notificationID) - \(notification?.payload.title)")

    },
                                handleNotificationAction: nil, 
                                settings: [
          kOSSettingsKeyAutoPrompt : false,
          kOSSettingsKeyInAppAlerts : false
    ]
)

0 个答案:

没有答案