kOSSettingsKeyInAppAlerts

kOSSettingsKeyInAppAlerts

本文介绍了使用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推送通知时,如何在应用程序处于前台时阻止警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 13:13