react-native-gitple-sdk
v2.0.4
Published
React-native SDK for Gitple
Downloads
45
Readme
react-native-gitple-sdk
React-Native for Gitple
- v1.2 : Using React Native < 0.59
- v2.0 : Using React Native >= 0.60
Install(v2.0)
- install gitple sdk
yarn add react-native-gitple-sdk
- install dependencies
yarn add [email protected] @react-native-community/netinfo
- linking native code on iOS
npx pod-install
Install(v1.2)
- install gitple sdk
npm i -S react-native-gitple-sdk
- linking library
react-native link react-native-gitple-sdk
Usage
import { Gitple, GitpleView } from 'react-native-gitple-sdk';
class GitpleChat extends React.Component {
render() {
let appCode = 'xxxxxxxxxxx';
let user = { id: 'xxxxxx', email: '[email protected]', name: 'reactnative' };
let hideHeader = true;
Gitple.initialize(appCode); // initialize gitple
Gitple.setUser(user).then(() => { // set user info
Gitple.unreadCount().then((count) => { // get unread count
console.info('Gitple get unreadCount:', count);
}).catch((error) => {
console.warn('Gitple get unreadCount failed. error:', error);
});
}).catch((error) => {
console.warn('Gitple setUser failed. error:', error);
});
return (
<GitpleView
hideHeader={hideHeader} />
);
}
}
Document
Powered by Gitple