Quantcast
Channel: Adobe Community : Discussion List - Using Flash Builder
Viewing all articles
Browse latest Browse all 1802

iOS app crashes when RemoteNotifier subscribes

$
0
0

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/WSd6d4f896b3a8801b7be2f55d138e29 d5e40-8000.html

http://help.adobe.com/en_US/air/build/WSd6d4f896b3a8801b7be2f55d138e29 d5e40-8000.htmlhttp://blogs.adobe.com/airodynamics/2012/05/29/push-notifications-supp ort-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
=newVector.<String>();
    preferredStyles
.push(NotificationStyle.ALERT,NotificationStyle.BADGE,NotificationStyle.SOUND);

    subscribeOptions
=newRemoteNotifierSubscribeOptions();
    subscribeOptions
.notificationStyles = preferredStyles;

    remoteNot
=newRemoteNotifier();
    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?


Viewing all articles
Browse latest Browse all 1802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>