测试我的设备上使用OneSignal服务发送推送通知我处理它的AppDelegate这样:通知警告禁止迅速
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
OneSignal.initWithLaunchOptions(launchOptions, appId: “[app ID]”)//this method I register device on apple server
return true
}
func application(application: UIApplication,
didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void){
print(“ARRIVED")
handleNotificationContent()// it’s not important for my question
}
我的问题是,当我收到通知,该应用程序是在前景中,警报自动显示,我不想显示它。 我该如何解决这个问题?
:悬而未决的标识“无”的使用。有什么建议么?当我使用false时,错误消失了? –
@PeterdeVries这就是你需要的:'OSNotificationDisplayType.none.rawValue' – oyalhi
@oyalhi。这工作,非常感谢。 –