Answers for "react native onesignal v3 hide popup alert foreground notification"

0

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);
 },
);
Posted by: Guest on October-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language