Created
November 10, 2017 17:19
-
-
Save Andarist/0d53dbd238df3a5ed85567db6ef4f69c to your computer and use it in GitHub Desktop.
customer sdk in RN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { AuthWebView } from '@livechat/chat.io-customer-auth'; | |
import { init } from '@livechat/chat.io-customer-sdk' | |
export default class App extends React.Component { | |
componentDidMount() { | |
const sdk = init({ license: 100004225 }) | |
sdk.on('connected', ({ chatsSummary, totalChats }) => { | |
console.log('on connected', { chatsSummary, totalChats }) | |
}) | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
<AuthWebView license={100004225} env={"labs"}/> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#fff', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment