使用Incoming OneSignal推送通知时,如何在应用程序处于前台时阻止警报? [英] How do I prevent Alert when App is on Foreground with Incoming OneSignal Push Notification?

查看:112
本文介绍了使用Incoming OneSignal推送通知时,如何在应用程序处于前台时阻止警报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的应用程序位于前台时,会出现一个警告。如何在接收推送通知时阻止这种情况出现?

When my app is in the foreground, there is a alert that appears. How do I prevent this from appearing when receiving push notifications?

推荐答案

didFinishLaunchingWithOptions AppDelegate 的方法你必须添加 kOSSettingsKeyInAppAlerts = NO

In your didFinishLaunchingWithOptions method of AppDelegate you have to add kOSSettingsKeyInAppAlerts = NO

[OneSignal initWithLaunchOptions:launchOptions appId:ONESIGNAL_APPID handleNotificationReceived:nil handleNotificationAction:nil
                            settings:@{kOSSettingsKeyInAppAlerts:@NO}];

这篇关于使用Incoming OneSignal推送通知时,如何在应用程序处于前台时阻止警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆