The cause of this problem is in the GCMIntentService.java, the code was starting the app via:
PendingIntent contentIntent =
PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
which means it was always using the same requestCode
. So the app was always using the first notification payload. The fix was to change the requestCode
for each notification.
int requestCode = new Random().nextInt();
PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode,
notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
We have fixed this issue in the new version of the PushPlugin which can be found at:
https://github.com/phonegap/phonegap-plugin-push
This is the version of the PushPlugin we announced at PhoneGap Day EU and it will be maintained as opposed to the version of the plugin you are currently using.