Integrate with Enhance - OpenFL
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
var onPermissionGranted = function() { // Success Enhance.enableLocalNotification("Game", "Play me!", 60); }; var onPermissionRefused = function() { // Failure }; Enhance.requestLocalNotificationPermission(onPermissionGranted, onPermissionRefused);
Methods
Enhance.requestLocalNotificationPermission
Void Enhance.requestLocalNotificationPermission(
Void->Void onPermissionGrantedCallback,
Void->Void onPermissionRefusedCallback
)
Parameters:
Void->Void onPermissionGrantedCallback
- Called when a permission to schedule local notifications is granted or not required.
Void->Void 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 delaySeconds
)
Parameters:
String title
- Title (header) of the notification.
String message
- Message (body) of the notification.
Int delaySeconds
- Delay of the notification (how long to wait after app becomes inactive). Use seconds.