Попытка интегрировать verl oop с react-native, используя react-native-sdk . Получение неопределенного значения при вызове функции VerloopSdk.showChat ();
import React, {Component} from 'react'; импортировать VerloopSdk из 'react-native-verl oop -sdk';
экспорт класса по умолчанию VerloopLiveChat расширяет Component {
async componentDidMount() {
const clientId = "<YOUR COMPANY ID>"; // it is same as https://<YOUR COMPANY ID>.verloop.io
await VerloopSdk.createAnonymousUserConfig(clientId);
//or
await VerloopSdk.createUserConfig(clientId, userId);
//optional
VerloopSdk.putCustomField(key, value);
//optional
VerloopSdk.setRecipeId(recipeId);
//optional
VerloopSdk.setUserEmail(email);
//optional
VerloopSdk.setUserPhone(phoneNumber);
//optional
VerloopSdk.setUserName(name);
VerloopSdk.showChat();
}
render() {
return null;
}
}