Native Extension Tip // iOS Push Notification Custom Sound

Playing a custom sound when a push notification arrives from the Apple Push Notification Service (APNS) is quite simple.

This tip assumes you're using our extension and that you've already got push notifications running.

Firstly you need to create your sound and export as an iOS supported format, such as caf.

Then you need to include the sound to your AIR application and make sure it's packaged with the application. If you are using adt then you just need to make sure it's included as a packaged resource in your script / command line. In Flash Builder you should make sure the sound is checked to be packaged in the following location:

Project / Properties / Actionscript Build Packaging / Apple iOS / Package Contents

To play this sound you must specify the filename of the sound in the notification payload. For example, lets say you've added a sound file named example.caf into your application, we can play this sound with the notification payload as below:

  1. {
  2. aps =
  3. {
  4. alert = "test example notification message";
  5. sound = "example.caf";
  6. };
  7. }

Then the custom sound will play when your notification arrives.

Best Children’s AIMIA Winner // ABC For Kids Portal

AIMIA Winner

Not sure how we missed this one, but a site we were involved with last year won an AIMIA for Best Children's, at the 18th AIMIA Awards earlier this year.

We developed several flash components for the site, including a player that would load games and media from the back catalogue of ABC developed games, audio and video and a series of games based around the "Giggle and Hoot" TV program. There's some more information on the components in a blog post that we posted earlier.

We've been so busy this year that this prestigious award must have slipped through but we were very happy to work with the ABC for Kids team and congratulate them on putting a great site together!

See the announcement here.

The AIMIA Awards are the peak Awards for the Interactive Media and Digital Content sectors in Australia, and year after year continue to deliver a strong and innovative showcase of award winning Australian digital content creations. Over 500 industry leaders, international and national interactive media celebrities, as well as federal and state ministers attend the ceremony.

Google Cloud Messaging using PHP

Google Cloud Messaging

Using PHP to send a message to a Google Cloud Messaging registered device is quite simple. In this example we'll be using curl to create a message request to send to the Google GCM server.

The code shown in this example is just going to demonstrate how to send a message to a registered device ID.
Continue reading Google Cloud Messaging using PHP

Google Cloud Messaging using C#

Google Cloud Messaging

Sending a notification to an Android device just keeps getting simpler and simpler. The current implementation of Google Cloud Messaging provides developers with a very simple way to send push notifications to a particular device.

What I'm going to show here is how to send a notification to a device once it's registered with your server.
Continue reading Google Cloud Messaging using C#

Native Extension Tip // Finding an Android Resource ID

Often when writing native extensions we've been faced with the problem of retrieving resources from the library. The official way to do this is to use the FREContext instance and the getResourceById() function. However there are several times when you'll want to access a resource packaged in your extension when the application has not been initialised (for example, onReceive events with a BroadcastReceiver), which initially seems impossible as you won't have access to your FREContext as yet.

There is however a simple workaround using the code below. You'll still need to be able to determine the package name of your application, which you can generally get from the Android Context.getPackageName().
Continue reading Native Extension Tip // Finding an Android Resource ID

Native Extension // Google Cloud Messaging (GCM)

After a few weeks, we've updated our Push Notification extension to support the newly introduced Google Cloud Messaging, which depreciated C2DM. So once again you'll be able to receive push notifications in your AIR applications on Android.

Google Cloud Messaging

It's now available as part of our extension package here. Happy messaging!

Native Extension Tip // ld: unknown option

When packaging an iOS AIR application you may encounter the following error:

Error occurred while packaging the application:
ld: unknown option: -ios_version_min
Compilation failed while executing: ld64

As in the following screenshot:

This error simply indicates that the native extension you are attempting to package requires some features from the iOS SDK or a version greater than the one you are currently using. To remedy this, make sure you are using a recent version of the iOS SDK and correctly including it in your packaging options.