react-native-push-notification: Regression from v2.1.1 to 2.2.0

Hey! Any major, possibly breaking, changes made to android notifications? I stopped receiving notifications after upgrading to 2.2.0. Can’t see any errors in adb logcat.

When reverting back to 2.1.1 I get the notifications again 😦

@npomfret @zo0r any idea? lead?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (24 by maintainers)

Most upvoted comments

The apple notification only goes to the notification centre if the app is in the background AND the notification is a ‘noisy’ notification, i.e. there is something to show (as opposed to a silent notification with content-available=1 that has nothing to show).

I think adding the line back in that sends the notification to the notification centre if the app is running in the background would please people. Seems harmless enough.

@npomfret Not sure this is the right direction for the project, remote notifications in the notification centre are a trivial part of notifications handling, see PushNotificationIOS for example.

I’ve tested my fork, looks like it’s working fine. I’m pushing it to production until this issue is resolved.

I submitted a PR with this fix to be accepted or rejected https://github.com/zo0r/react-native-push-notification/pull/269

My gut feeling about react-native libraries is that iOS and Android should behave as close together as possible, when the API is the same (I know it’s not always that simple).

@mikelambert I understand that iOS might not be in your concern right now, so it makes sense you’d want to make the android version better, but the cost is that we diverge from PushNotificationIOS and I’m not sure it’s worth it.

I feel like my PR is a good compromise between the 2 approaches.

@npomfret @mikelambert @zo0r As for further commits in this project I think it would be wise to keep PushNotificationIOS in mind when changing the core behaviour for the community’s sake 😃

@npomfret OK, I think I got it. You are seeing the notification in your JS code, I get the same behaviour, but as you can see in the code snippet above, the code in RNPushNotificationListenerService.sendNotification calls RNPushNotificationJsDelivery.notifyNotification which sends the notification data ONLY to the JS app.

The problem is that when the app is not running I would like the notification to be presented to the user, as it used to work before, I don’t want to create it myself with a local notification (although I might have to do it now)

What I understand from you is that it doesn’t work for you either, remote notifications are not shown, and you bypass that by issuing a local notification from the JS code, right?