Adobe AIR Notifications - Enhance
Local Notifications
Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.
Example Usage
private function onPermissionGranted():void { // Success Enhance.enableLocalNotification("Game", "Play me!", 60); } private function onPermissionRefused():void { // Failure } private function init():void { Enhance.requestLocalNotificationPermission(onPermissionGranted, onPermissionRefused); }
Methods
Enhance.requestLocalNotificationPermission
void Enhance.requestLocalNotificationPermission(
Function onPermissionGrantedCallback,
Function onPermissionRefusedCallback
)
Parameters:
Function onPermissionGrantedCallback
- Called when a permission to schedule local notifications is granted or not required.
Function onPermissionRefusedCallback
- Called when a permission to schedule local notifications is refused. Trying to enable a notification will not have any effect.
Enhance.enableLocalNotification
void Enhance.enableLocalNotification(
String title,
String message,
int delay
)
Parameters:
String title
- Title (header) of the notification.
String message
- Message (body) of the notification.
int delay
- Delay of the notification (how long to wait after app becomes inactive). Use seconds.