Skip to main content
Inspiring
December 21, 2011
Question

Push notifications... at last!

  • December 21, 2011
  • 11 replies
  • 10513 views

For several weeks I have been working an ANE for iOS Push Notifications (APNS). I now have a beta with the following specs.

Methods:

registerForAPN( badges : Boolean = true, sounds : Boolean = true, alerts : Boolean = true, newsStandContent : Boolean = false ) : void;

unregisterForAPN() : void;

askForAPNtypes() : void;

setLocalBadge( badgeNumber : Number) : void;

Last method doesn't really have to do with APN, but was build in because you probably will need it.

All methods are void. For consistency all data is sent back through events.

Events:

REGISTERING - Just for debugging. Means registerForRemoteNotificationTypes was called.

REGISTERED - Means registration was successful. Returns deviceToken on event.deviceToken

FAILED - Means registration failed. Returns error string on event.info

UNREGISTERING - Just for debugging. Means unregisterForRemoteNotifications was called.

NOTIFICATION - Returns the payload of an APN as a string on event.info (not yet thoroughly tested, since I don't need it in my own implementation)

TYPES - Returns the currently registered APN-types as booleans on event.types.badges, event.types.sounds, event.types.alerts, event.types.newsStandContent.

Send me a PM with your e-mail address if you are interested in this ANE. Source code will not be released, just a ready-to-use ANE.

This topic has been closed for replies.

11 replies

August 14, 2012
August 14, 2012

Hi Anders,

I would like to use your ANE in my project. Could you please send a copy to my email fayaz.rvce@gmail.com

Participant
August 14, 2012

Salve,

sono in ferie, rientro in azienda giorno 27/08/2012.

Prego di inoltrare le richieste al seguente indirizzo di posta: staff@eniac.it

oppure relativamente ad attività web: claudio.palazzolo@eniac.it, damiano.degan@eniac.it.

Distinti Saluti.

Spina Domenico.

Participant
August 7, 2012

Hello,

I am interested for the APN air extension.Would you please send me your ane ? Thanks a lot.

My emails is nishith_89@yahoo.com

Participant
August 7, 2012

Salve,

sono in ferie, rientro in azienda giorno 27/08/2012.

Prego di inoltrare le richieste al seguente indirizzo di posta: staff@eniac.it

oppure relativamente ad attività web: claudio.palazzolo@eniac.it, damiano.degan@eniac.it.

Distinti Saluti.

Spina Domenico.

Participant
June 4, 2012

HI I'm interesting in your apn air exteinsion.

Would you please send your ane let me to try?

Thanks a  lot.

My email is UNjerromy@gmail.com

Participating Frequently
May 25, 2012

hello and congratulation for you solution!


i'm intersted in the ane and/or a sample for flash as3 (commercial).

please contact me: painschen@web.de

Inspiring
May 30, 2012

I'm interested in how to use this in Flash Professional too!

Inspiring
May 30, 2012

I have discontinued the distribution of my extension for push notifications until further notice. One developer says the extension makes his app crash. I cannot confirm this, and at the moment I don't have the time to investigate it further.

Participant
January 25, 2012

Hello Anders,

I would like to have your comercial version of this ANE. Please, check MESSAGES.

Thanks a lot and congratulations.

Fernando

Participating Frequently
January 18, 2012

Hi anders-tbl,

Great that you got the Push notifications working... but I have some questions on it, it will be helpful if you can put up light that how you breakthrough them...

1. Does your implementation is able to give "aps" data to the app when app was not running in background and push notification comes to iPhone? if you can give a hint it will be helpful..

2. How did you overcome these "undefined selector" issues for " _stageLoaded" and " notifyASyncMessages"...

I too implemented the push notifications but for question 1 I get the aps data when app is running in background as "didFinishLaunchingWithOptions" never fires in native extension. and for question 2 it seems that these are internal engine methods which for now I have just over ridden with blank implentation to avoid crashes...

Nice if you can help..

Best Wishes,

Sanniv.

Inspiring
January 19, 2012

Hello sanniv_ios!

1. Yes, APNs are working even if the app isn't running.

2. I did not run into that problem when I created my ANE. I did run into several other problems though, which made me spend a silly amount of time developing it.

If you want to see it in action you can try the free version of my app:

http://itunes.apple.com/us/app/wordpox-free/id482879840?mt=8

Send a PM to me with your e-mail address if you would like my ANE-solution.

marchbold
Inspiring
January 19, 2012

We've ended up using an implementation that uses runtime method injection. Any other ios traditional method of using the setDelegate on the sharedApplication will result in the errors you're seeing sanniv_ios.

Basically you need to look into the class_addMethod functions.

If you do it any other way you'll break some of the flash application functionality.

air native extensions // https://airnativeextensions.com
marchbold
Inspiring
January 13, 2012

Congrats on getting it working.

Just wondering if you can answer a small question for me, related to one of the comments above.

I can't seem to get the delegate class to work consistently, once I set it, the rest of the extension interface back to the flash application seems to break.

So for example if as soon as I call

[[UIApplication sharedApplication] setDelegate:myDelegate];

Then any call to things like: FREDispatchStatusEventAsync fail and cause the app to crash.

Is this something to do with destroying some ANE default delegate class?

air native extensions // https://airnativeextensions.com
Participant
January 11, 2012

Hi,

I am also interested in using APNs with Flash Builder 4.6. I have been searching the web and have not found an answer, documentation or any tutorials on using APNs. I am using Flash Builder 4.6 and Windows 7.

If any one has any info please post links or some code.

Thanks

Mike

Participant
January 11, 2012

hi mj93,

to compile your app you need mac os, with XCode environment.. in windows you can't.

I'm working on APNS extension, with some issue,  and when finished will post the code ..

seems that this thing of APNs is a taboo!

bye

Known Participant
January 12, 2012

Hey people

I try use this example. But for me make a error.

VerifyError: Error #1014: Class

pl.randori.air.nativeextensions.ios::APNSExtension could not be found.

at runtime::ContentPlayer/loadInitialContent()

at runtime::ContentPlayer/playRawContent()

at runtime::ContentPlayer/playContent()

at runtime::AppRunner/run()

at ADLAppEntry/run()

at global/runtime::ADLEntry()

I use flash CS5.5 and mac lion

I get the ANE rename for SWC include in the library.

Have some solution?

tanks

Bruno Brustoloni e Oliveira

Inspiring
January 10, 2012

My Adobe AIR app with push notifications has just been released on App Store:

http://itunes.apple.com/us/app/wordpox-premium/id481002756

Users are happy, and everything seems to work just great

Participant
January 10, 2012

Hi Anders!

can i ask you how to solve an issue on development of my APNS native extension?

In my native library, I'm working with [UIApplication sharedApplication] setDelegate:"my object" to delegate UIApplication dispatching events to "my object": but when i try to dispatch event with FREDispatchStatusEventAsync in method application:didRegisterForRemoteNotificationsWithDeviceToken the application crashes!

Can you help me please? if you want i can post my code!