b8ne / react-native-pusher-push-notifications

Manage pusher interest subscriptions and notification events in Javascript.
MIT License
96 stars 85 forks source link

I don't receive notification when the app is open #81

Open satrioyuda1 opened 2 years ago

satrioyuda1 commented 2 years ago

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.

Thavananthan commented 2 years ago

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

Thavananthan commented 2 years ago

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

leonardo409188 commented 2 years ago

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

anniewey commented 12 months ago

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...");
    }
SergeyMelnyk commented 7 months ago

+1, same question