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

iOS app crashes when RemoteNotifier subscribes

New Here ,
Nov 13, 2013 Nov 13, 2013

Copy link to clipboard

Copied

I am attempting to get push notifications working. I am building my app in FlashBuilder 4.6 using Starling 1.4.1 and AIR 3.9.

I have been referencing these two sources:

http://help.adobe.com/en_US/air/build/WSd6d4f896b3a8801b7be2f55d138e29d5e40-8000.html

http://help.adobe.com/en_US/air/build/WSd6d4f896b3a8801b7be2f55d138e29d5e40-8000.htmlhttp://blogs.adobe.com/airodynamics/2012/05/29/push-notifications-support-in-ios/

My app keeps crashing on the subscribe call. I have tried deploying to both an iPad4 and an iPhone4, both running iOS7. It crashes on both.

My code:

if (RemoteNotifier.supportedNotificationStyles.length > 0)
{
    preferredStyles
= new Vector.<String>();
    preferredStyles
.push(NotificationStyle.ALERT, NotificationStyle.BADGE, NotificationStyle.SOUND);

    subscribeOptions
= new RemoteNotifierSubscribeOptions();
    subscribeOptions
.notificationStyles = preferredStyles;

    remoteNot
= new RemoteNotifier();
    remoteNot
.addEventListener(RemoteNotificationEvent.TOKEN, tokenHandler);
    remoteNot
.addEventListener(RemoteNotificationEvent.NOTIFICATION, notificationHandler);
    remoteNot
.addEventListener(StatusEvent.STATUS, statusHandler);

    remoteNot
.subscribe(subscribeOptions);
}


The command that crashes the app is remoteNot.subscribe. I have tried putting that command in an activate event handler, and it still crashes (not right away, but when I minimize the app and then restore it). None of the remoteNot event handlers ever get called.

The app runs fine if I comment out that one line of code.

Anyone have any ideas or tips?

Views

2.1K

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