React Native Functionality
Contents
The Mobile React Native library wraps the native SDKs and so the exposed methods follow the native methods quite closely. There are some differences however, particularly in how the responses should be handled, which is why we have created this guide as a reference for React Native development.
No Start Engine
A major difference in the React Native SDK is that there is no startEngine method. The engine is started automatically within the React Native library when the modules are created.Message Stream
A guide to working with the message stream can be found here.User Data
A guide on how to handle collecting user data can be found here.Get Device ID
Returns the Device ID for this device:SailthruMobile.getDeviceId().then(function(id) {
// Handle Device ID
}, function(e){
// Handle error
});
iOS Only methods
These methods only have an effect on the iOS platform. They can be safely called on both platforms but they will have no impact on Android:// Turns on or off iOS SDK crash handlers
SailthruMobile.setCrashHandlersEnabled(true);
// Registers for push notifications
SailthruMobile.registerForPushNotifications();
// Used to dismiss message detail presented in SailthruMobile.presentMessageDetail()
SailthruMobile.dismissMessageDetail()