Created
November 4, 2015 01:59
-
-
Save marchbold/8dd07d27e91e24369e51 to your computer and use it in GitHub Desktop.
Setting a delayed / scheduled notification with the Notifications ANE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://airnativeextensions.com/extension/com.distriqt.Notifications