wix / react-native-notifications

React Native Notifications
MIT License
3.21k stars 763 forks source link

registerNotificationReceivedBackground documentation #987

Open mutablestudio opened 11 months ago

mutablestudio commented 11 months ago

IN https://wix.github.io/react-native-notifications/docs/notifications-events the docs say

 Notifications.events().registerNotificationReceivedBackground((notification: Notification, completion: (response: NotificationCompletion) => void) => {
      console.log("Notification Received - Background", notification.payload);

      // Calling completion on iOS with `alert: true` will present the native iOS inApp notification.
      completion({alert: true, sound: true, badge: false});
        });

but the completion response is actually of type NotificationBackgroundFetchResult (you'll see a Typescript error) and calling completion() does nothing on Android device (os 12, API 31). This happened in v4.3.5 so I updated to v5.0.0 and it's still there.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

chenweigh commented 9 months ago

same problem +1

Step

click some button to postLocalNotification delay 10s, then return home page.

after 10s, registerNotificationReceivedBackground no output.

SwapnilRathore commented 3 weeks ago

same problem +1