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

Push notifications... at last!

Explorer ,
Dec 21, 2011 Dec 21, 2011

Copy link to clipboard

Copied

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.

TOPICS
Development

Views

10.0K

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
Community Beginner ,
Dec 21, 2011 Dec 21, 2011

Copy link to clipboard

Copied

Congratulations Anders!

If anyone is interested in my solution for APNs you can PM me too and you can give it a try here

http://flashsimulations.com/2011/12/16/apple-push-notification-service-native-extension-for-adobe-ai...

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
New Here ,
Jan 01, 2012 Jan 01, 2012

Copy link to clipboard

Copied

hi anders and piotr did your soultion works with flash builder windows version or it must be used in mac ???

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
Explorer ,
Jan 02, 2012 Jan 02, 2012

Copy link to clipboard

Copied

Seems like you need to use Mac when building the IPA.

You still need Mac when submitting to iTunes though. (I run Mac with WMware in Windows)

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
Explorer ,
Jan 10, 2012 Jan 10, 2012

Copy link to clipboard

Copied

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

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
New Here ,
Jan 10, 2012 Jan 10, 2012

Copy link to clipboard

Copied

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!

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
New Here ,
Jan 11, 2012 Jan 11, 2012

Copy link to clipboard

Copied

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

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
New Here ,
Jan 11, 2012 Jan 11, 2012

Copy link to clipboard

Copied

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

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
Community Beginner ,
Jan 12, 2012 Jan 12, 2012

Copy link to clipboard

Copied

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

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
Engaged ,
Jan 12, 2012 Jan 12, 2012

Copy link to clipboard

Copied

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

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
Community Beginner ,
Jan 18, 2012 Jan 18, 2012

Copy link to clipboard

Copied

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.

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
Explorer ,
Jan 19, 2012 Jan 19, 2012

Copy link to clipboard

Copied

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.

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
Engaged ,
Jan 19, 2012 Jan 19, 2012

Copy link to clipboard

Copied

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

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
Engaged ,
Jan 24, 2012 Jan 24, 2012

Copy link to clipboard

Copied

Actually sanniv_ios, I see you're problem.

The method injection works for any of the methods that are called while the app is running but the didFinishLaunchingWithOptions function seems to get called before the extension has been initialised.

Did you end up figuring out a way of getting the launch options without using this function? I can't find any other way of getting a notification passed in a application startup ...

air native extensions // https://airnativeextensions.com

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
New Here ,
Jan 25, 2012 Jan 25, 2012

Copy link to clipboard

Copied

Hello Anders,

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

Thanks a lot and congratulations.

Fernando

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
Explorer ,
May 25, 2012 May 25, 2012

Copy link to clipboard

Copied

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

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
Engaged ,
May 30, 2012 May 30, 2012

Copy link to clipboard

Copied

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

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
Explorer ,
May 30, 2012 May 30, 2012

Copy link to clipboard

Copied

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.

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
New Here ,
May 31, 2012 May 31, 2012

Copy link to clipboard

Copied

Dear Anders,

Anyway thanks alot for your reply.

Regards, 

Danh Le - Flash Developer

Tel: +84 907 506 614

http://danz-media.com/

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
Engaged ,
May 31, 2012 May 31, 2012

Copy link to clipboard

Copied

If you're still looking for a working APNS ANE we've released a package of ANE's that contains a fully working solution. We use it in all of our projects and it's being used in the development of several other developers applications. It's a cross platform solution as well, making use of C2DM on Android.

You can check it out here:

http://labs.distriqt.com/native-extensions/

Cheers,

Michael

air native extensions // https://airnativeextensions.com

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
New Here ,
Jun 04, 2012 Jun 04, 2012

Copy link to clipboard

Copied

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

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
New Here ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

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

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
New Here ,
Aug 07, 2012 Aug 07, 2012

Copy link to clipboard

Copied

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.

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
Guest
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

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

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
New Here ,
Aug 14, 2012 Aug 14, 2012

Copy link to clipboard

Copied

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.

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