0.0.3 • Published 3 months ago

@simpu/simpu-rn-livechat v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Simpu react-native livechat sdk

Twitter

GitHub license

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:

Propsdescriptiontypedefault value
app_idAn eight character string, provided whern setting your live chat.string''
public_keyAn long character string, provided whern setting your live chat.textstring''
namename of the logged in userstring
emailemail of the logged in userstring''
phoneemail of the logged in userstring''
user_ida unique id of the logged in userstring 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