Below are the methods that you can use to manage the Campaign library for Cordova.
Console error reporting
| Parameter | Type | Definition |
|---|
message | string | Error message |
Returns the current appKey.
| Parameter | Type | Definition |
|---|
callback | appKeyCallback | The callback that handles the response |
| Parameter | Type | Definition |
|---|
callback | getBadgeCallback | The callback that handles the response |
| Parameter | Type | Definition |
|---|
callback | sdkVersionCallback | The callback that handles the response |
| Parameter | Type | Definition |
|---|
callback | registrationDetailsCallback | The callback that handles the response |
Returns the current native SDK version in use.
| Parameter | Type | Definition |
|---|
callback | sdkVersionCallback | The callback that handles the response |
Manually initialize the library. It waits until an event occurs before beginning to interact with the Acoustic servers. For example, you might not want to create a userid/channelid until after a user logs into your system.
Requires the autoInitialize setting in CampaignConfig.json to be set to false.
Executes phone home request which may update the userId and channelId to match changes made on the server. Typically used after contact merge on Engage during user identification. This allows the inbox to be synchronized between multiple installations of the application on different devices for the same user. Note, phone home will execute once every 24 hours automatically without calling this API.
Sends an event to the Acoustic infrastructure. The status will be reported to method registered via setEventQueueCallbacks.
| Parameter | Type | Definition |
|---|
event | Event | The event to send to the server |
flush | Boolean. Default value - true. | When this is true, the event is sent immediately and flushes the queue of events to be sent. When it is false, the event is queued and will be automatically sent when the queue is automatically flushed at a later date. This parameter is optional. |
Removes specific user attributes .This method also includes automatic retrying of failures. This method has no callbacks, but the status of the request will be sent to the JavaScript callback that was registered with setAttributeQueueCallbacks or if none were registered, it will be queued.
| Parameter | Type | Definition |
|---|
attributes | Array | The list of attribute keys to be removed |
Updates any user attributes while leaving the existing attributes alone. This method also includes automatic retrying of failures. This method has no callbacks, but the status of the request will be sent to the JavaScript callback that was registered with setAttributeQueueCallbacks or if none were registered, it will be queued.
| Parameter | Type | Definition |
|---|
attributes | Object | The list of attributes in key/value format |
| Parameter | Type | Definition |
|---|
callback | Function | Retrieves a safe area for device |
Allow Cordova developer to detect when a push action is not handled.
Lets you detect when a push action is not handled, but was previously registered.
Lets you check when attributes are sent to the server. If an attribute is sent while the application is not active, the callback will be queued until the next time this method is called to register a callback handler.
| Parameter | Type | Definition |
|---|
callback | attributeQueueSuccessCallback | The callback that handles the response |
callback | attributeQueueFailureCallback | The callback that handles the response |
Sets the badge count for the iOS home screen.
| Parameter | Type | Definition |
|---|
badge | Integer | A new number of badges |
Lets you register and respond to iOS static categories.
| Parameter | Type | Definition |
|---|
callback | categoryCallback | The callback that handles the response |
categoryName | String | Name of category to respond to in iOS payload |
actions | Array | An array of actions |
Lets you check when events are sent to the server. If the event is sent while the application is not active, the callback will be queued until the next time this method is called to register a callback handler.
| Parameter | Type | Definition |
|---|
successCallback | eventQueueSuccessCallback | The callback that handles the response |
errorCallback | eventQueueFailureCallback | The callback that handles the response |
Lets you change the Android icon.
| Parameter | Type | Definition |
|---|
drawableName | String | Name of a drawable image in app bundle |
Lets you handle custom actions.
| Parameter | Type | Definition |
|---|
callback | registeredActionCallback | The callback that handles the response |
type | String | Custom Action type from the "notification-action" or the "category-actions" section of the payload |
Notifies you when a registration occurs. This will only be called once when the application registers with the Acoustic servers. If the application is not active when this happens, the callback will be queued until the next time this method is called to register a callback handler.
| Parameter | Type | Definition |
|---|
callback | registrationCallback | The callback that handles the response |
An internal function to translate a dictionary of attributes with dates into integers so they can be processed by the library.
| Parameter | Type | Definition |
|---|
attributes | Array of objects | Attributes to be converted |
Returns an array of objects.
An internal function to translate a dictionary of attributes with dates represented as integers back into JavaScript date objects.
| Parameter | Type | Definition |
|---|
attributes | Array of objects | Attributes to be converted |
Returns an array of objects.
An internal function to translate timestamps from integers or strings to JavaScript date objects.
| Parameter | Type | Definition |
|---|
events | Array | List of events to translate |
Returns an array of events.
Stop handling custom actions.
| Parameter | Type | Definition |
|---|
type | String | Custom Action type from the "notification-action" or the "category-actions" section of the payload |
Queries if a user has been invalidated.
| Parameter | Type | Definition |
|---|
callback | Function | Retrieves the status of a user. |
| Parameter | Type | Definition |
|---|
appKey | String | A short string for identifying the app in the co.acoustic.mobilepush system |
Properties supported by the result object
| Property | Type | Definition |
|---|
attributes | Object | Key/value pairs that were updated if the operation was set or update |
domain | String | Either "channel" or "user" depending on which method was called |
error | String | Description of the error |
keys | Array | A list of keys that were deleted when the operation is delete |
operation | String | Either "update" or "delete" depending on which method was called |
Properties supported by the result object
| Property | Type | Definition |
|---|
attributes | Object | Key/value pairs that were updated if the operation was set or update |
domain | String | Either "channel" or "user" depending on which method was called |
keys | Array | A list of keys that were deleted when the operation is delete |
operation | String | Either "update" or "delete" depending on which method was called |
| Parameter | Type | Definition |
|---|
error | String | Description of the error |
| Parameter | Type | Definition |
|---|
payload | Object | Entire Android or iOS payload for example {"aps":{"alert":"hello world", "category":"example"}} |
identifier | String | String identifying button to JavaScript processing click of button |
| Property | Type | Definition |
|---|
attributes | Object | Details about the event, freeform key/value pairs |
attribution | String | The campaign name associated with the event (optional) |
name | String | Event name. The library automatically sends events named "sessionStart", "sessionEnd", "urlClicked", "appOpened", "phoneNumberClicked". |
timestamp | Date | Indicates when the event occurred. |
type | String | Event type. The library automatically sends events of "simpleNotification" and "application" types. |
Properties supported by the result object
| Property | Type | Definition |
|---|
events | Array | List of events that were sent |
error | String | Description of the error |
| Parameter | Type | Definition |
|---|
events | Array | List of events that were sent |
| Parameter | Type | Definition |
|---|
badgeCount | Integer | The number of badges |
| Parameter | Type | Definition |
|---|
actionPayload | Object | It is normally in the format { "type": <type>, "value": <value> } but can be anything that is sent in the "notification-action" or the "category-actions" section of the payload. |
payload | Object | Entire Android or iOS payload for example {"aps":{"alert":"hello world", "category":"example"}} |
| Parameter | Type | Definition |
|---|
callback | registeredCallback | The callback that handles the response |
co.acoustic.mobilepushRegistered | Boolean | Indicates if the device is registered with the Acoustic infrastructure |
providerName | String | The name of a provider, e.g. "APNS" or "GCM". Lets you determine if the device has registered with the push provider's service and if it has registered with the Acoustic infrastructure. |
providerRegistered | Boolean | Indicates if the device is registered with a push provider system (APNS or GCM). |
| Property | Type | Definition |
|---|
channelId | String | A short string identifying the channel or device |
deviceToken | String | A medium string that represents the iOS device on APNS |
registrationId | String | A medium string that represents the Android device on GCM |
userId | String | A short string identifying the user, possibly multiple devices |
| Parameter | Type | Definition |
|---|
registration | Registration | Registration details |
| Parameter | Type | Definition |
|---|
Registration | Registration | Registration details |
| Parameter | Type | Definition |
|---|
version | String | A short string representing the version of the Campaign library |
Notification action plugins for Cordova apps