从通知中心启动应用程序的Distriqt推送通知句柄

时间:2014-03-18 05:16:51

标签: air notifications push-notification

我刚刚购买了Distriqt ANE包,并且在某些情况下无法获得Push Notification。 当应用程序没有启动并且我收到PN它显示在通知区域,但是当我尝试从通知中心打开应用程序(通知点击)时,我无法访问打开应用程序的PN。

我已阅读文档并询问Distriqt支持,但没有运气。 在我们的文档中:

  

未运行:通知区域中显示通知。   单击时,应用程序启动。当你调用register()时   你会立即收到通知事件。

支持团队回答:

  

您需要确保先添加通知的侦听器   你打电话给注册。您应该立即收到通知   当你从应用程序启动时调用register   通知中心

我的代码:

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);

但是在注册调用之后没有事件被触发。它只是做标准的寄存器例程,就是这样。

请帮忙!

2 个答案:

答案 0 :(得分:0)

刚从GitHub更新到最新版本2.6.iOS.2.1 它运作得很好。

答案 1 :(得分:0)

此功能仅在最近的一个版本中添加。在报告错误之前,请务必尝试更新扩展程序。

由于