distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

Push Notifications always show recent instead of selected #319

Closed Nikos-Laskaridis closed 8 years ago

Nikos-Laskaridis commented 9 years ago

Hi guys

I have an issue with the push notifications ANE. I send some test notifications with the nice php you have in the tutorial. When the app is inactive, they show up correctly in Android's notifications area (slide down from the top). But whatever notification I tap, my app always shows the most recent instead of the one selected.

I use the following code:

function initNotifications() { PushNotifications.init("..."); if (PushNotifications.isSupported==true) { PushNotifications.service.addEventListener( PushNotificationEvent.REGISTER_SUCCESS, pn_registerSuccessHandler ); PushNotifications.service.addEventListener( PushNotificationEvent.UNREGISTERED, pn_unregisterSuccessHandler ); PushNotifications.service.addEventListener( PushNotificationEvent.NOTIFICATION, pn_notificationHandler ); PushNotifications.service.addEventListener( PushNotificationEvent.ERROR, pn_errorHandler ); PushNotifications.service.register("..."); } }

function pn_notificationHandler( event:PushNotificationEvent ):void { var data:Object = JSON.parse(event.data); // show data... }