react native onesignal v3 hide popup alert foreground notification
OneSignal v3:
OneSignal.inFocusDisplaying(0);
OneSignal v4:
OneSignal.setNotificationWillShowInForegroundHandler(
async notificationReceivedEvent => {
console.log(
'OneSignal: notification will show in foreground:',
notificationReceivedEvent,
);
let notification = notificationReceivedEvent.getNotification();
console.log('notification: ', notification);
const data = notification.additionalData;
console.log('additionalData: ', data);
console.log('setNotificationOpenedHandler', item.id);
//Silence notification by calling complete() with no argument
notificationReceivedEvent.complete(notification);
},
);