我正在使用 Distriqt Push Notifications Extension,如果用户在首次运行时不允许 PN,我将无法使其正常工作:应用程序结束注册用户,因为它声明 PN 已启用且可用。
我执行以下操作:
if (PushNotifications.isSupported()) {
registerPushNotifications();
}
private function registerPushNotifications():void {
PushNotifications.service.addEventListener(PushNotificationEvent.REGISTER_SUCCESS, onPushNotificationToken);
PushNotifications.service.register(MODEL.Configuration.GCM_SENDER_ID);
}
private function onPushNotificationToken(event:PushNotificationEvent):void {
if (PushNotifications.service.isEnabled) { registerDevice(); }
}
如果用户不允许它不PushNotifications.service.isEnabled
应该是假的?什么时候变成假的?我应该如何处理这种情况?