new Notifications()
Class that provides notification capabilities.
Class that provides notification capabilities. Callers should use
MobileBackend's Notifications() property.
- Source:
Methods
-
deregisterForNotifications(deviceToken, appId, successCallback, errorCallback)
Deregisters the current Cordova app running on the device for receiving push notifications.
-
Deregisters the current Cordova app running on the device for receiving push notifications.
Parameters:
Name Type Argument Description deviceToken
String Platform-specific successCallback token. appId
String Platform-specific application reverse domain identifier. successCallback
Notifications~successCallback <optional>
Optional callback invoked on success (deprecated use promises instead). errorCallback
Notifications~errorCallback <optional>
Optional callback invoked on failure (deprecated use promises instead). - Source:
Returns:
- Type
- Promise.<(NetworkResponse|NetworkResponse)>
Examples
deviceToken: "AxdkfjfDfkfkfkfjfFdjfjjf=", deviceToken is sent from device.
appId: "com.yourcompany.project"
mcs.MobileBackend.getNotifications() .deregisterForNotifications("YOUR_DEVICE_TOKEN", "com.oracle.mobile.cloud.OMCPushNotifications", "1.0.0") .then(deregisterSuccess, deregisterError); function deregisterSuccess(response){ console.log(response.statusCode);// returns statusCode for this function. } function deregisterError(response){ }
-
getDevicePlatform()
Returns a string with device information used by Notifications.
-
Returns a string with device information used by Notifications
- Source:
Returns:
The device specific information for platform.- Type
- String
Example
: "IOS,ANDROID"
-
registerForNotifications(deviceToken, appId, appVersion, notificationProvider, successCallback, errorCallback)
Registers the current Cordova app running on the device for receiving push notifications.
-
Registers the current Cordova app running on the device for receiving push notifications.
Parameters:
Name Type Argument Description deviceToken
String Platform-specific device token. appId
String Platform-specific application reverse domain identifier. appVersion
String Platform-specific application version.. notificationProvider
String successCallback
Notifications~successCallback <optional>
Optional callback invoked on success (deprecated). errorCallback
Notifications~errorCallback <optional>
Optional callback invoked on failure (deprecated). - Source:
Returns:
- Type
- Promise.<(NetworkResponse|NetworkResponse)>
Examples
deviceToken: "AxdkfjfDfkfkfkfjfFdjfjjf=", deviceToken is sent from device.
appId: "com.yourcompany.project"
appVersion: "1.0.2"
mcs.MobileBackend.getNotifications() .registerForNotifications("YOUR_DEVICE_TOKEN", "com.oracle.mobile.cloud.OMCPushNotifications", "1.0.0") .then(registerSuccess, registerError); function registerSuccess(response){ console.log(response.statusCode);// returns statusCode for this function. } function registerError(response){ }