react-native-pusher-push-notifications icon indicating copy to clipboard operation
react-native-pusher-push-notifications copied to clipboard

I don't receive notification when the app is open

Open satrioyuda1 opened this issue 4 years ago • 6 comments
trafficstars

I receive a notification when the app is running in the background and closed. but when the app opens i don't receive any notification. is there a setting i need to add ?, but when i check in console.log i receive the notification data, thank you.

satrioyuda1 avatar Oct 27 '21 13:10 satrioyuda1

i face same issue anyone find the solution for this issue ?

Thavananthan avatar Feb 17 '22 12:02 Thavananthan

hi, i know everyone busy with your work. if you have any idea or suggestions for this issue

Thavananthan avatar Mar 21 '22 05:03 Thavananthan

I created a custom component using react-native-toast-message to show when I get a notification with the app open.

leonardo409188 avatar Jun 07 '22 13:06 leonardo409188

It appears to be the default behaviour for not showing up in notification tray when app is in foreground. I faced the same issue in both iOS and Android. Did anyone found a way to force it to show up in notification tray instead of using own custom component?

//from README.md
switch (notification.appState) {
      case 'inactive':
      // inactive: App came in foreground by clicking on notification.
      //           Use notification.userInfo for redirecting to specific view controller
      case 'background':
      // background: App is in background and notification is received.
      //             You can fetch required data here don't do anything with UI
      case 'active':
      // App is foreground and notification is received. Show a alert or something.
      default:
        break;
    } else {
        // console.log("android handled notification...");
    }

anniewey avatar Jul 07 '23 00:07 anniewey

+1, same question

SergeyMelnyk avatar Dec 01 '23 21:12 SergeyMelnyk