Tim Nuwin Tim Nuwin - 1 year ago 159
iOS Question

How do I prevent Alert when App is on Foreground with Incoming OneSignal Push Notification?

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

Answer Source

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

[OneSignal initWithLaunchOptions:launchOptions appId:ONESIGNAL_APPID handleNotificationReceived:nil handleNotificationAction:nil
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download