taivo / parse-push-plugin

Push notification plugin for Cordova/Phonegap/ionic on Parse platform
118 stars 102 forks source link

FIX: (Android) Opening incorrect notification from notification tray #75

Closed quilligana closed 7 years ago

quilligana commented 7 years ago

So in production we discovered that when we set <preference name="ParseMultiNotifications" value="true" />, tapping on a notification in the tray always opens the most recent notification (regardless of which one you have tapped).

This was caused by the override method getNotification in ParsePushPluginReceiver.java where contentIntentRequestCode and deleteIntentRequestCode are always set to 0 (therefore overriding the existing pending intents). We have fixed this by allowing this ID to be set to a random value if, and only if, <preference name="ParseMultiNotifications" value="true" /> is set.

Our latest production version now opens the correct notification from the tray when multiple are present.

Also, so code tidy up in same file.

Feedback welcome.

taivo commented 7 years ago

Thanks for your contribution, @quilligana.

If you don't mind me asking, what are you using this plugin for?