OpenBack React Native Module
The OpenBack React Native module makes it possible for your React Native application to interact with the OpenBack library. The module is avilable for iOS and Android.
Install the module in your package:
Link the native module to your iOS and Android applications:
Before building the application, some minimal platform specific integration steps are needed.
Create a Cocoapods Podfile in the
pod init, then edit the Podfile adding
pod OpenBack as well as enabling the dynamic framework feature
use_frameworks!. Install OpenBack using
Follow the iOS Integration Documentation to fully configure OpenBack.
For best results, make sure to configure and start OpenBack from the application delegate
Edit the application
/android/app/build.gradle to include the OpenBack library repository location and dependency.
OpenBack library uses a few android support libraries at version 28. You might need to use the gradle
resolutionStrategy if you want to use lower versions.
Follow the Android Integration Documentation to fully configure OpenBack.
For best results, make sure to configure and start OpenBack from the main application
The OpenBack React Native library contains 2 modules:
OpenBack(alias for RNOpenBack in NativeModules)
OpenBackAppInbox(alias for RNOpenBackppInbox in NativeModules)
If your application needs COPPA to be enabled, set the COPPA compliant status with this function. If COPPA is enabled, messages will not run unless compliant is set to true.
When your user requests that all the data should be erased, set this value to true. It will inform the OpenBack server to remove all logs for the current user. All future logs will be erased after processing. If you wish to be fully GDPR complient, you also need to enable GDPR in your application settings on the OpenBack Dashboard.
Returns the current OpenBack SDK version.
Logging a Goal
At any point, you can log a goal that is associated with a message. Make sure to use the Goal code, not the Goal name.
User Info & Custom Values
Set a custom trigger value. Value can be
For the trigger index, use kOBKCustomTrigger1 to kOBKCustomTrigger10.
The application can pass some extra user information using a simple dictionary object by setting the following fields:
|string||Address line 1|
|string||Address line 2|
|string||Advertising identifier set by the application|
|string||ISO-2 country code|
|string||Date of birth YYYY-MM-DD|
|string||Opting in for message updates "true"/"false"|
|string||Phone Number (international format)|
|string||Custom user identifier 1|
|string||Custom user identifier 2|
|string||Custom user identifier 3|
|string||Custom user identifier 4|
|string||Custom user identifier 5|
Note on Custom User Identifiers
Identity is for use with the OpenBack API. If you are not an OpenBack API client, don't use them. Identities are bound to the current OpenBack user, so changing any one of them will reset user and campaign usage. A usage example: when your application has users that can login and logout, you can set one of the Identity to a token used in your system to identify that user. Later on, using the OpenBack API, you can fetch details from that user.
App Inbox API
App Inbox is available on iOS since version 1.8.7 and Android since version 2.4.6.
|boolean||true if message is marked as read|
|boolean||true if message is actionable (see executeMessage)|
|integer||unix epoch time when the message was delivered|
|string||title of the message|
|string||content of the message|
|string||payload of the message|
Do not modify
_id when passing a message back to the API to remove, mark as read or execute it. Those values are used to retrieve the message on the native library side.
Total number of messages in inbox.
Total number of unread messages in inbox.
Retrieve all Inbox messages. Messages are sorted by display time, from newest to oldest.
Retrieve all Inbox read messages. Messages are sorted by display time, from newest to oldest.
Retrieve all Inbox unread messages. Messages are sorted by display time, from newest to oldest.
Mark an Inbox message as read. Returns true if successful.
Mark Inbox messages as read. Returns true if successful.
Mark all Inbox messages as read. Returns true if successful.
Remove message from the Inbox. Returns true if successful.
Remove messages from the Inbox. Returns true if successful.
Remove all message from the Inbox. Returns true if successful.
If a message is actionable, call this method to execute the associated action. Messages can have an actionable URL, deep-link, video, image, custom HTML. Executing a message will set the read status to true. Returns true if successful.
Listen for App Inbox Changes
NativeEventEmitter from the
OpenBackInbox and add listener for the following events:
OBKAppInboxMessageAdded: A message was added
OBKAppInboxMessageRead: A message was read
OBKAppInboxMessageExpired: A message has expired
Currently, only iOS passes the message linked to the event. It will be added to Android in the future.