Helpshift SDK X plugin for React Native.
Follow the Getting Started page of Helpshift Developer Guide for details like app ID, domain, etc.
- Node v18 or above
- Android Development Setup
- iOS Development Setup
// Import helpshift API's from the 'helpshift-plugin-sdkx-react-native' plugin.
import {
install,
showConversation,
showFAQsWithConfig,
showFAQSectionWithConfig,
logout,
login
} from 'helpshift-plugin-sdkx-react-native';
let installConfig = {
'enableLogging': true,
'manualLifecycleTracking': false,
'runtimeVersion': EXAMPLE_REACTNATIVE_VERSION // Developer need to pass react-native version.
}
let appId = Platform.select({
android: <Android_Platform_Id>,
ios: <iOS_Platform_Id>,
});
if (appId != null) {
install(appId, <domain>, installConfig);
} else {
//Display your error here.
}
- additionaly for iOS platform there is a requirement to link the native parts of the library:
$ npx pod-install
const config = {<SDK_CONFIGRATION_OBJECT_MAP>};
showConversation(config);
showFAQsWithConfig(<SDK_CONFIGRATION_OBJECT_MAP>);
showFAQSectionWithConfig(
<FAQ_SECTION_PUBLISH_ID>, <SDK_CONFIGRATION_OBJECT_MAP>
);
showSingleFaqWithConfig(
<FAQ_QUESTION_PUBLISH_ID>, <SDK_CONFIGRATION_OBJECT_MAP>
)
Where <SDK_CONFIGRATION_OBJECT_MAP> is config object. you can refer here For SDK Configrations.
setLanguage(<LANGUAGE_CODE>)
For <LANGUAGE_CODE> please refer this document here
For details on SDK Configuration, follow the SDK Configuration page on Helpshift Developer Guide.
let installConfig = {
'enableLogging': true,
}
install(<APP_ID>, <domain>, installConfig);
const config = {
presentFullScreenOniPad: false
};
showConversation(config);
For details on user related APIs, follow Helpshift Developer Guide.
let config = {
userName: "<USER_NAME>",
userEmail: "<USER_EMAIL>",
userId: "<USER_ID>",
userAuthToken: "<GENERATED_USER_AUTH_TOKEN>"
};
login(config, (isLoginSuccessful: boolean) => {
console.log("Is login successful " + isLoginSuccessful)
});
logout()
You need to install your notification plugin to use notifications. Use the registerPushToken
and handlePush
APIs for this. Refer iOS and Android Helpshift Developer Guide for more details.
const cifs = { stock_level: { type: 'number', value: '1505' }, age: { type: 'number', value: '20' } };
const config = {
cifs: cifs,
};
showConversation(config);
Refer Helpshift Developer Guide CIF Support for more details.
handleProactiveLink(<PROACTIVE_LINK> , <USER_LOCAL_CONFIG>);
Refer Helpshift Developer Guide For Outbound Support for more details.