• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

RemoteNotifier events not firing after invoking subscribe method

Community Beginner ,
Jul 15, 2013 Jul 15, 2013

Copy link to clipboard

Copied

I am creating an iOS application.  I need to use APNS.  The application is set up at Apple and is working, but I am unable to test Push Notifications because I am unable to get a device token.  From my understanding issuing RemoteNotifier.subscribe should cause RemoteNotificationEvent.TOKEN to fire.  This never happens.  The code is below.  None of the RemoteNotifier events fires.

var preferredNotificationStyles:Vector.<String> = new Vector.<String>;

preferredNotificationStyles.push(NotificationStyle.ALERT);

preferredNotificationStyles.push(NotificationStyle.SOUND);

preferredNotificationStyles.push(NotificationStyle.BADGE);

var subscribeOptions:RemoteNotifierSubscribeOptions = new RemoteNotifierSubscribeOptions();

subscribeOptions.notificationStyles = preferredNotificationStyles;

var rn:RemoteNotifier = new RemoteNotifier();

rn.addEventListener(RemoteNotificationEvent.TOKEN, sendDeviceTokenToServer);

rn.addEventListener(RemoteNotificationEvent.NOTIFICATION, notificationReceivedByApp);

rn.addEventListener(StatusEvent.STATUS, subscriptionFailureCallback);

rn.subscribe(subscribeOptions);

Views

790

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 20, 2013 Jul 20, 2013

I was able to get this working by moving the code that deals with RemoteNotifier into its own actionscript class.  I originally had it within the <script> of the Flex <view>.

Votes

Translate

Translate
Community Beginner ,
Jul 20, 2013 Jul 20, 2013

Copy link to clipboard

Copied

LATEST

I was able to get this working by moving the code that deals with RemoteNotifier into its own actionscript class.  I originally had it within the <script> of the Flex <view>.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines