README
react-native-customerly
Getting started
$ npm install react-native-customerly --save
$ npm install --production
Mostly automatic installation
$ react-native link react-native-customerly
PAY ATTENTION ‼️: You also need to complete the additional steps before using the SDK
Additional steps
iOS
- Run
cd ios
on your main project folder - Run
pod install
- Open you AppDelegate.m
- Add import
#import <CustomerlySDK/CustomerlySDK-Swift.h>
- Add the following code in your
didFinishLaunchingWithOptions
:[[Customerly sharedInstance] configureWithAppId:@"YOUR_APP_ID"]; [[Customerly sharedInstance] activateApp];
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import io.customerly.Customerly;
- Inside your onCreate method add the following code:
Customerly.configure(this, "<YOUR_APP_ID>");
Usage
import RNCustomerly from "react-native-customerly";
await RNCustomerly.registerUser(email, userId, name, attributes, company);
RNCustomerly.logoutUser(() => {});
RNCustomerly.openSupport(() => {});
await RNCustomerly.isSdkAvailable();
RNCustomerly.setAttributes(attributes, callback);
RNCustomerly.setCompany(attributes, callback);
RNCustomerly.setSupportEnabled(enabled, callback);
RNCustomerly.isSupportEnabled(callback);
RNCustomerly.setSurveyEnabled(enabled, callback);
RNCustomerly.isSurveyEnabled(callback);
RNCustomerly.trackEvent(eventName, callback);
RNCustomerly.update(callback);
RNCustomerly.setVerboseLogging(enabled, callback);
RNCustomerly.setAttachmentsAvailable(enabled, callback);
For all the explanation and the methods signature you can check directly the native SDK at the following links: