Notifications



Notifications: Unity (C#)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

private void OnPermissionGranted() {
    // Success
    Enhance.EnableLocalNotification("Game", "Play me!", 60);
}

private void OnPermissionRefused() {
    // Failure
}

Enhance.RequestLocalNotificationPermission(OnPermissionGranted, OnPermissionRefused);

Methods

void Enhance.RequestLocalNotificationPermission( Action onPermissionGrantedCallback, Action onPermissionRefusedCallback )

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (onPermissionGrantedCallback will be still fired).

Parameters:
Action onPermissionGrantedCallback - Specifies the action which is triggered when the permission is granted by the user.

Action onPermissionRefusedCallback - Specifies the action which is triggered when the permission is refused by the user.

void Enhance.EnableLocalNotification( string title, string message, int delay )

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
stringtitle - Title of the notification.

stringmessage - Message of the notification.

intdelay - Delay of the notification, in seconds.

void Enhance.DisableLocalNotification()

Disable any local notification that was previously enabled.

Notifications: Android (Java)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

// Toggle notification

if(!isNotificationEnabled) {
    Enhance.enableLocalNotification("Game", "Play me!", 60);
    isNotificationEnabled = true;
}

else {
    Enhance.disableLocalNotification();
    isNotificationEnabled = false;
}

Methods

void Enhance.enableLocalNotification( String title, String message, int delaySeconds )

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
Stringtitle - Title of the notification.

Stringmessage - Message of the notification.

intdelay - Delay of the notification, in seconds.

void Enhance.disableLocalNotification()

Disable any local notification that was previously enabled.

Notifications: iOS (Objective-C)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

// Toggle notification

if(!isNotificationEnabled) {
    [Enhance enableLocalNotificationWithTitle:@"Game" message:@"Play me!" delay:60];
    isNotificationEnabled = true;
}

else {
    [Enhance disableLocalNotification];
    isNotificationEnabled = false;
}

Methods

void [Enhance requestLocalNotificationPermission: (id)delegate ]

Request a permission from the user to show local notifications. This will invoke a system pop-up.

Parameters:
id delegate - Specifies the object which implements the PermissionDelegate protocol (for more information about this type, see the Protocols section).

void [Enhance enableLocalNotificationWithTitle: (NSString*)title message:(NSString*)message delay:(int)delay; ]

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
NSString*title - Title of the notification.

NSString*message - Message of the notification.

intdelay - Delay of the notification, in seconds.

void [Enhance disableLocalNotification]

Disable any local notification that was previously enabled.

Protocols

protocol PermissionDelegate<NSObject> -(void)onPermissionGranted; -(void)onPermissionRefused;

Notifications: OpenFL (Haxe)




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( onPermissionGrantedCallback:Void->Void, onPermissionRefusedCallback:Void->Void ):Void

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (onPermissionGrantedCallback will be still fired).

Parameters:
Void->Void onPermissionGrantedCallback - Specifies the function which is triggered when the permission is granted by the user.

Void->Void onPermissionRefusedCallback - Specifies the function which is triggered when the permission is refused by the user.

Enhance.enableLocalNotification( title:String, message:String, delaySeconds:Int ):Void

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
Stringtitle - Title of the notification.

Stringmessage - Message of the notification.

Intdelay - Delay of the notification, in seconds.

Enhance.disableLocalNotification():Void

Disable any local notification that was previously enabled.

Notifications: Adobe Air (AS3)




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( onPermissionGrantedCallback:Function, onPermissionRefusedCallback:Function ):void

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (onPermissionGrantedCallback will be still fired).

Parameters:
Function onPermissionGrantedCallback - Specifies the function which is triggered when the permission is granted by the user.

Function onPermissionRefusedCallback - Specifies the function which is triggered when the permission is refused by the user.

Enhance.enableLocalNotification( title:String, message:String, delay:int ):void

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
Stringtitle - Title of the notification.

Stringmessage - Message of the notification.

intdelay - Delay of the notification, in seconds.

Enhance.disableLocalNotification():void

Disable any local notification that was previously enabled.

Notifications: Defold (Lua)




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

nil enhance.requestLocalNotificationPermission( function onPermissionGrantedCallback, function onPermissionRefusedCallback )

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (onPermissionGrantedCallback will be still fired).

Parameters:
function onPermissionGrantedCallback - Specifies the function which is triggered when the permission is granted by the user.

function onPermissionRefusedCallback - Specifies the function which is triggered when the permission is refused by the user.

nil enhance.enableLocalNotification( string title, string message, number delay )

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
stringtitle - Title of the notification.

stringmessage - Message of the notification.

numberdelay - Delay of the notification, in seconds.

nil enhance.disableLocalNotification()

Disable any local notification that was previously enabled.

Notifications: Construct 2 (Visual)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

System On start of layout
    Enhance Request permission to schedule local notifications

Enhance On local notification permission granted
    Enhance Enable local notification with title "Game", "Play me!" and delay 60

Actions

Enhance Request permission

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (the On permission granted condition will be still fired).

Enhance Enable local notification

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
Title - Title of the notification.

Message - Message of the notification.

Delay - Delay of the notification, in seconds.

Enhance Disable local notification

Disable any local notification that was previously enabled.

Conditions

Enhance On permission granted

Triggered when permission to show local notifications is granted.

Enhance On permission rejected

Triggered when permission to show local notifications is refused.

Enhance Is permission granted

Check whether the permission to show local notifications is granted.

Returns:
Returns true if permission is granted, false otherwise.

Notifictions: Cordova (JS)




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

void Enhance.requestLocalNotificationPermission( onPermissionGrantedCallback, onPermissionRefusedCallback )

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (onPermissionGrantedCallback will be still fired).

Parameters:
function onPermissionGrantedCallback - Specifies the function which is triggered when the permission is granted by the user.

function onPermissionRefusedCallback - Specifies the function which is triggered when the permission is refused by the user.

void Enhance.enableLocalNotification( title, message, delaySeconds )

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
string title - Title of the notification.

string message - Message of the notification.

int delaySeconds - Delay of the notification, in seconds.

void Enhance.disableLocalNotification()

Disable any local notification that was previously enabled.

Notifications: Stencyl (Visual)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage


Action Blocks



Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (the on local notification permission granted wrapper will be still fired).



Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
text Title - Title of the notification.

text Message - Message of the notification.

number Delay - Delay of the notification, in seconds.



Disable any local notification that was previously enabled.

Wrapper Blocks



Define actions which are triggered when the permission is granted by the user.



Define actions which are triggered when the permission is refused by the user.

Notifications: Construct 3 (Visual)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

System On start of layout
    Enhance Request permission to enable local notifications

Enhance On local notification permission granted
    Enhance Enable local notification with title "Game", "Play me!" and delay 60

Actions

Enhance Request permission

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (the On permission granted condition will be still fired).

Enhance Enable local notification

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
Title - Title of the notification.

Message - Message of the notification.

Delay - Delay of the notification, in seconds.

Enhance Disable local notification

Disable any local notification that was previously enabled.

Conditions

Enhance On permission granted

Triggered when permission to show local notifications is granted.

Enhance On permission refused

Triggered when permission to show local notifications is refused.

Enhance Is permission granted

Check whether the permission to show local notifications is granted.

Returns:
Returns true if permission is granted, false otherwise.

Notifications: Xamarin (C#)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

private void OnPermissionGranted() {
    // Success
    Enhance.EnableLocalNotification("Game", "Play me!", 60);
}

private void OnPermissionRefused() {
    // Failure
}

Enhance.RequestLocalNotificationPermission(OnPermissionGranted, OnPermissionRefused);

Methods

void Enhance.RequestLocalNotificationPermission( Action onPermissionGrantedCallback, Action onPermissionRefusedCallback )

Request a permission from the user to show local notifications. This won't have any effect on Android devices as you don't need a permission to schedule local notifications there (onPermissionGrantedCallback will be still fired).

Parameters:
Action onPermissionGrantedCallback - Specifies the action which is triggered when the permission is granted by the user.

Action onPermissionRefusedCallback - Specifies the action which is triggered when the permission is refused by the user.

void Enhance.EnableLocalNotification( string title, string message, int delaySeconds )

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
string title - Title of the notification.

string message - Message of the notification.

int delaySeconds - Delay of the notification, in seconds.

void Enhance.DisableLocalNotification()

Disable any local notification that was previously enabled.

Notifications: MIT App Inventor (Visual)




Local Notifications are reminders which show up on your screen after the app becomes inactive for a specific amount of time.

Example Usage

when EnableButton.Click
do
    call EnhanceConnector1.EnableLocalNotification
         title        = "Game"
         message      = "Play me!"
         delaySeconds = 60

when DisableButton.Click
do
    call EnhanceConnector1.DisableLocalNotification

Methods

void EnableLocalNotification

Schedule a new local notification, if possible. The notification will persist until you disable it manually. For example, if you set a notification for 60 seconds, it will invoke this notification 60 seconds after the app is closed every time.

Parameters:
text title - Title of the notification.

text message - Message of the notification.

number delaySeconds - Delay of the notification, in seconds.

void DisableLocalNotification

Disable any local notification that was previously enabled.

Notifications: Construct 3 (Visual)




Local Notifications are reminders displayed on your mobile device's screen after the app becomes inactive.

Actions

Request permission
Ask for local notifications permission.

Enable local notification
Enable a new local notification.

Disable local notification
Disable any local notification.

Conditions

On permission granted
Triggered when permission to show local notifications is granted.

On permission refused
Triggered when permission to show local notifications is refused.

Is permission granted
Check whether the permission to show local notifications is granted.

Notifications: Xamarin (C#)




Local Notifications are reminders displayed on your mobile device's screen after the app becomes inactive.

1) Ask for local notifications permission:
Enhance.RequestLocalNotificationPermission(Action onPermissionGranted, Action onPermissionRejected);

2) Enable a new local notification:
Enhance.EnableLocalNotification(string title, string messsage, int delaySeconds);

3) Disable the local notification:
Enhance.DisableLocalNotification();

Notifications: MIT App Inventor (Visual)




Local Notifications are reminders displayed on your mobile device's screen after the app becomes inactive.

1) Enable a new local notification:
EnableLocalNotification (Text title, Text message, Number delaySeconds)

2) Disable the local notification:
DisableLocalNotification