0.0.3 • Published 3 months ago
@simpu/simpu-rn-livechat v0.0.3
Simpu react-native livechat sdk
For more information about Simpu live chat visit the official simpu developer docs.
Supported Mobile platforms
- Android
- iOS
Deployment targets
due to third party libraries like pusher, this lbrary will only support:
- iOS 13.0 and above
- Android 7 and above. Android 6 will require desugaring.
Example Application
By cloning this repository you can check the React Native example application, a minimal application, you can connect your app_id and public_key to test .
Image Preview
Installation
npm install @simpu/simpu-rn-livechat
or
yarn add @simpu/simpu-rn-livechat
Usage
import SimpuLiveChat from '@simpu/simpu-rn-livechat';
// ...
const App = () => {
return (
<View>
... // place component anywhere around your App.jsx or App.tsx
<SimpuLiveChat
app_id={"app id"}
public_key={"publik key"}
/>
</View>
);
};
Props
The complete set of options is described below:
Props | description | type | default value |
---|---|---|---|
app_id | An eight character string, provided whern setting your live chat. | string | '' |
public_key | An long character string, provided whern setting your live chat.text | string | '' |
name | name of the logged in user | string | |
email | email of the logged in user | string | '' |
phone | email of the logged in user | string | '' |
user_id | a unique id of the logged in user | string or number | "" |
Methods
import SimpuLiveChat from '@simpu/simpu-rn-livechat';
const Help = () => {
const handleOpenLiveChat = ()=>{
//call the live chat open method with or without parameters
SimpuLiveChat.open()
}
return (
<View>
<TouchableOpacity onPress={handleOpenLiveChat}>
<Text>Talk to an Agent</Text>
</TouchableOpacity>
</View>
);
};
License
MIT
Made with create-react-native-library