"dependencies": {
"react-native-intercom-rn-library": "0.0.23"
}
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-intercom-rn-library
and add RNIntercomRnLibrary.xcodeproj
libRNIntercomRnLibrary.a
to your project’s Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainActivity.java
import com.reactlibrary.RNIntercomRnLibraryPackage;
to the imports at the top of the filenew RNIntercomRnLibraryPackage()
to the list returned by the getPackages()
methodAppend the following lines to android/settings.gradle
:
include ':react-native-intercom-rn-library'
project(':react-native-intercom-rn-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-intercom-rn-library/android')
Insert the following lines inside the dependencies block in android/app/build.gradle
:
compile project(':react-native-intercom-rn-library')
import RNIntercomRnLibrary from 'react-native-intercom-rn-library';
RNIntercomRnLibrary.intializeSDK(INTERCOM_API_KEY, INTERCOM_APP_ID)
//User authentification
RNIntercomRnLibrary.registerUserWithUserId(USER_ID)
//or
RNIntercomRnLibrary.registerUserWithEmail(USER_EMAIL)
must be authentificated
by his email or user_idfor logout a user use
RNIntercomRnLibrary.logout()
RNIntercomRnLibrary.presentHelpCenter()
RNIntercomRnLibrary.presentMessenger()
messenger with initial message
RNIntercomRnLibrary.presentMessengerWithMessage('my message')
hide messenger
RNIntercomRnLibrary.hideMessenger()
RNIntercomRnLibrary.logEventWithName('EVENT_NAME')
Log event with datas
RNIntercomRnLibrary.logEventWithNameAndDatas('EVENT_NAME', ["key":"data"])
Intercom library version (iOS / Android)
RNIntercomRnLibrary.getVersion( (error: any, version: string)=>{})
Author: smartness-community
Source Code: https://github.com/smartness-community/react-native-intercom-rn-library
#react-native #react #mobile-apps