Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marchbold/8dd07d27e91e24369e51 to your computer and use it in GitHub Desktop.
Save marchbold/8dd07d27e91e24369e51 to your computer and use it in GitHub Desktop.
Setting a delayed / scheduled notification with the Notifications ANE
Notifications.init( APP_KEY );
if (Notifications.isSupported)
{
var notification:Notification = new Notification();
notification.tickerText = "Hello";
notification.title = "My Notification";
notification.body = "Hello World";
var scheduled:Date = new Date(2015,12,13, 1,1,1);
var now:Date = new Date();
var secondsFromNow:int = int((scheduled.time - now.time)/ 1000);
notification.delay = secondsFromNow;
Notifications.service.notify( notification.id, notification );
}
// com.distriqt.Notifications
@marchbold
Copy link
Author

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