-
Notifications
You must be signed in to change notification settings - Fork 12
Library events
Alexander Boldyrev edited this page Aug 14, 2025
·
2 revisions
Events can be subscribed on using the following code snippet:
MobileMessaging.register('<event name>',
function (eventData) {
console.log('Event: ' + eventData);
}
);where <event name> is the name of event listed in the table.
| Event name | Event data | Description |
|---|---|---|
messageReceived |
message object | Occurs when new message arrives, see separate section for all available message fields |
notificationTapped |
message object | Occurs when notification is tapped. |
tokenReceived |
Cloud token | Occurs when an APNs device token is received. Contains device token - a hex-encoded string received from APNS. Returns device token as hex-encoded string. |
registrationUpdated |
Infobip internal ID | Occurs when the registration is updated on backend server. Returns internalId - string for the registered user. |
actionTapped |
message, actionId, text | Occurs when user taps on action inside notification or enters text as part of the notification response. |
installationUpdated |
installation | Occurs when save request to the server is successfully sent. |
userUpdated |
user | Occurs when save request to the server is successfully sent. |
personalized |
Occurs when request for personalization is successfully sent to the server. | |
depersonalized |
Occurs when request for depersonalization is successfully sent to the server. |
Supported message object fields are described below:
message: {
messageId: <unique message id>,
title: <title>,
body: <message text>,
sound: <notification sound>,
vibrate: <true/false, notification vibration setting (Android only)>,
icon: <notification icon, optional (Android only)>,
silent: <true/false, disables notification for message>,
category: <notification category (Android only)>,
receivedTimestamp: <absolute timestamp in milliseconds that indicates when the message was received>,
customPayload: <any custom data provided with message>,
originalPayload: <original payload of message (iOS only)>,
contentUrl: <media content url if media provided>,
seen: <true/false, was message seen or not>,
seenDate: <absolute timestamp in milliseconds that indicates when the message was seen>,
chat: <true/false, indicates was message triggered by chat or not>,
browserUrl: <string, url to open in browser>,
deeplink: <string, deeplink url>,
webViewUrl: <string, url to display in webview>,
inAppOpenTitle: <string, custom title for in-app open button>,
inAppDismissTitle: <string, custom title for in-app dismiss button>
}
In this wiki you can also find support for users and installations objects
Geofencing part of the library has been deprecated and will not be maintained further. Last library version with geofencing support is 2.5.1.
| Event name | Event data | Description |
|---|---|---|
geofenceEntered |
geo object | Occurs when device enters a geofence area. |
Supported geo object fields are described below:
geo:
area: {
id: <area id>,
center:
lat: <area latitude>,
lon: <area longitude>
},
radius: <area radius>,
title: <area title>
}
}
If you have any questions or suggestions, feel free to send an email to [email protected] or create an issue.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
GeofencingDEPRECATED- Privacy settings
- In-app chat
- Migration guides
- Migration guide to version 7.9.x
- Migration guide to version 7.x.x
- Migration guide to version 6.2.x
- Migration guide to version 6.1.x
- Migration guide to version 6.x.x
- Migration guide to version 1.x.x
- Migration guide to version 2.2.x
- Migration guide to version 3.x.x
- Migration guide to version 4.x.x
- Migration guide to version 4.1.x
- Troubleshooting
- JSON Web Token (JWT) structure and generation example
- Trusted Domains Security