Skip to content

getIncoming returns the same message over and over again on Android #15

Closed
szimek opened this Issue Dec 5, 2012 · 1 comment

2 participants

@szimek
szimek commented Dec 5, 2012

The issue is that when an app receives a notification and it's used to open the app, then when phone is locked and unlocked and the app calls #getIncoming on resume event, then the app will receive the same notification again.

UA Android plugin stores alert and extras on PushNotificationPlugin class (https://github.com/urbanairship/phonegap-ua-push/blob/master/android-sample/src/com/urbanairship/phonegap/sample/IntentReceiver.java#L86-L87) and returns them when getIncoming is called (https://github.com/urbanairship/phonegap-ua-push/blob/master/android-sample/src/com/urbanairship/phonegap/plugins/PushNotificationPlugin.java#L144-L148).

These values are never cleared, unless another notification is used to open the app. This way successive calls to getIncoming will always return the same notification over and over again.

I'm not sure if it's "by design" or it's a bug, but it can be fixed by clearing PushNotificationPlugin.incomingAlert and incomingExtras when getIncoming is called. Also I'm not sure if it happens on iOS as well.

@rlepinski

Looks like this was fixed (4 months ago) with this commit: 1112b76

Thanks for pointing out the issue

@rlepinski rlepinski closed this Apr 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.