Question

I've just bought Distriqt ANE pack and can't get Push Notification worked for some case. When application isn't started and I receive PN it shows in notification area, but when I try to open app from notification centre ( clicking by notification ) I can't get access to PN which opened application.

I've read documentation and asked Distriqt support but with no luck. In docs we have:

Not running: A notification is displayed in the notification area. When clicked the application is started. When you call register() you'll immediately receive the notification event.

Support team answered:

You need to make sure you add the listener for notifications before you call register. You should receive the notification immediately when you call register if the application was started from the notification center

My code:

PushNotifications.init( PN_DEV_KEY ); //it doesnt init for 2nd time!
if(PushNotifications.isSupported) {
PushNotifications.service.addEventListener( PushNotificationEvent.REGISTERING, onPnRegistering );
PushNotifications.service.addEventListener( PushNotificationEvent.REGISTER_SUCCESS, pnRegisterResult );
PushNotifications.service.addEventListener( PushNotificationEvent.UNREGISTERED, pn_unregisterSuccessHandler );
PushNotifications.service.addEventListener( PushNotificationEvent.NOTIFICATION, onPushNotification );
PushNotifications.service.addEventListener( PushNotificationEvent.FOREGROUND_NOTIFICATION,  onForegroundNotificationReceived );
PushNotifications.service.addEventListener( PushNotificationEvent.ERROR, pn_errorHandler );
var registerResult:Boolean = PushNotifications.service.register(GCM_SENDER_ID);

But after register call no event has fired. It just do standard register routine and that's it.

Please help!

Was it helpful?

Solution

This feature was only added in one of the more recent releases. Always try to update your extensions before reporting a bug.

Thanks

OTHER TIPS

Just updated to the latest version 2.6.iOS.2.1 from GitHub and it works just fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top