Run the command below in your React Native project to update the plugin version:
npm install [email protected] --save
It is necessary to update the iOS native dependencies
Open the your Podfile
and replace:
pod 'InLocoEngage-iOS-SDK', '~> 4.4.3'
with
pod 'InLocoEngage-iOS-SDK', '~> 5.5.0'
Inside the ios
folder of your project, run the following command to install the iOS dependencies:
pod install
Link the dependencies:
react-native link react-native-inlocoengage
Run from the command line:
cd iospod install
The Inloco SDK initialization now relies on the presence of initialization files for each platform. On the Android platform, it is necessary to put a file called inloco.xml
in the main/res/values
. On the iOS platform, it is necessary to add a InLocoOptions.plist
in your iOS project. We recommend that the previous initialization is replaced with the new one, according to the integration section.
The previous initialization using the InLocoEngage.init(options)
is then replaced with InLocoEngage.init()
.
import InLocoEngage from 'react-native-inlocoengage';// v4 initialization (should be removed)const options = Platform.select({ios: {appId: "<YOUR_IOS_APP_ID>",logsEnabled: true},android: {appId: "<YOUR_ANDROID_APP_ID>",logsEnabled: true},});InLocoEngage.init(options);// v5 initialization: Initializes the Inloco SDK by using initialization filesInLocoEngage.init();
Create an file called inloco.xml
in the main/res/values
directory of your Android project:
<?xml version="1.0" encoding="utf-8"?><resources><!-- Your Inloco App id--><string name="inloco_app_id" translatable="false">YOUR_APP_ID</string><!-- Whether SDK logs are enabled --><bool name="inloco_log_enabled">true</bool></resources>
Add a file called InLocoOptions.plist
to your iOS project:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><!-->The Application ID<--><key>applicationId</key><string>YOUR-APP-ID</string><!-->Indicates whether the SDK should present logs or not. Default value: true<--><key>logEnabled</key><true/></dict></plist>
You can download examples of both files in the following links: InLocoIOptions.plist and inloco.xml
If you still prefer to initialize the Inloco SDK using the options object, you can do as shown below:
import InLocoEngage from 'react-native-inlocoengage';//options object remains the same on both v4 and v5const options = Platform.select({ios: {appId: "<YOUR_IOS_APP_ID>",logsEnabled: true},android: {appId: "<YOUR_ANDROID_APP_ID>",logsEnabled: true},});//v5 initialization with optionsInLocoEngage.initWithOptions(options);//v4 initialization with options. SHOULD BE REMOVEDInLocoEngagein.init(options);
New functions concerning user privacy were added to provide more fine-grained control amongst data usage. To know more, refer to the documentation.
V4 | V5 |
InLocoEngage.isWaitingUserPrivacyConsent() | InLocoEngage.checkConsent() |
InLocoEngage.giveUserPrivacyConsent() | InLocoEngage.allowConsentTypes(), InLocoEngage.denyConsentTypes() |
It is recommended to take a look at the corresponding documentation:
V4 | V5 |
InLocoEngage.onNotificationPresented() | Removed. ❌ |
InLocoEngage.onNotificationReceived() | Removed. ❌ |