Skip to content

Instantly share code, notes, and snippets.

@Andarist
Created November 10, 2017 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andarist/0d53dbd238df3a5ed85567db6ef4f69c to your computer and use it in GitHub Desktop.
Save Andarist/0d53dbd238df3a5ed85567db6ef4f69c to your computer and use it in GitHub Desktop.
customer sdk in RN
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