Skip to content

Instantly share code, notes, and snippets.

@marchbold
Last active August 29, 2015 13:57
Show Gist options
  • Save marchbold/9798401 to your computer and use it in GitHub Desktop.
Save marchbold/9798401 to your computer and use it in GitHub Desktop.
Simple example of displaying a local notification.
try
{
Notifications.init( APP_KEY );
if (Notifications.isSupported)
{
Notifications.service.addEventListener( NotificationEvent.NOTIFICATION_SELECTED, notifications_notificationSelectedHandler, false, 0, true );
//
// This will trigger the start up notification if the application was started from a delayed notification
// Also this will perform the required registration for notifications permission on iOS 8+
Notifications.service.register();
var notification:Notification = new Notification();
notification.tickerText = "Hello";
notification.title = "My Notification";
notification.body = "Hello World";
Notifications.service.notify( notification.id, notification );
}
}
catch (e:Error)
{
}
...
function notifications_notificationSelectedHandler( event:NotificationEvent ):void
{
}
// com.distriqt.Notifications
@marchbold
Copy link
Author

Sorry for not seeing this comment.

The APP_KEY is created through the website:

See this tutorial for more information:

More information on this ANE:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment