Push Notification enables developers to push messages to mobile devices using Push technology.

In order to implement this in a Flex Mobile AIR application, you will need to use Native Extension to do so. A freely available Native Extension for Push Notifications has been developed by Piotr Koscierzynski. The extension can be downloaded from here.

In case you are looking for a paid native extension with good support, easy to use examples and bonus native extensions, you can check this package by distriqt.

The blog post provides pretty good explanation on using the Native Extension in your projects. But many people have reported there of facing few issues while using the extension. Even I was not able to make it work initially. Going through the blog comments and some research at my end, I was able to get it working. Just in case you are not able to make it work, make sure you have followed the below mentioned points while using it:

  • Make sure you compile the project on a Mac machine. This Native Extension will give you an error while publishing a build on a Windows machine.
  • It works fine with AIR 3.2 and iOS 5.1
  • Make sure the provisioning file you are using has been enabled for Push Notifications.
  • Entitlements additions required in the app.xml:

[cc lang=”xml”]


get-task-allow aps-environment development application-identifier XXXXXXXX.com.rjdesignz.testapns keychain-access-groups XXXXXXXX.* ]]>

[/cc]

In order to make the push notifications work, you will need to develop a server side script. A good tutorial to implement a server side script is available here.

Sample project source can be downloaded from here.

Recommended readings for Flex/Flash/AIR Mobile Applications: