Integrate with Enhance - Defold
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
function on_permission_granted() enhance.enableLocalNotification("Game", "Play me!", 60) end function on_permission_refused() -- Failure end enhance.requestLocalNotificationPermission(on_permission_granted, on_permission_refused)
Methods
enhance.requestLocalNotificationPermission
nil 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
nil enhance.enableLocalNotification(
string title,
string message,
number delay
)
Parameters:
string title
- Title (header) of the notification.
string message
- Message (body) of the notification.
number delay
- Delay of the notification (how long to wait after app becomes inactive). Use seconds.