How to prevent alert with incoming OneSignal notification?

user3671635 picture user3671635 · Dec 16, 2016 · Viewed 10.2k times · Source

I use OneSignal push notifications. When android app is in foreground and receives a notification, it creates an alert box with the notification. How to prevent this from appearing when receiving notifications?

Answer

Nati Sholman Oskar picture Nati Sholman Oskar · Dec 19, 2016

From The SDK documentation - When you startInit OneSignal, make sure to call inFocusDisplaying with "None" to disable OneSignal's in app AlertBox.

also on NotificationReceivedHandler section -

Important behavior notes - If you will be displaying your own in app message when a notification is received make sure to call inFocusDisplaying with None to disable OneSignal's in app AlertBox.