ninchat-rn-sdk
v1.1.0
Published
Ninchat embed react native component
Downloads
35
Readme
Installation
install using `npm i ninchat-rn-sdk`ninchat-rn-sdk has 4 peer dependencies. You need to have all of those installed to be able to use ninchat-rn-sdk component.
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-webview": "*",
"react-native-blob-util": "*"
}Usage
import NinchatEmbedRN, {NinchatEmbedRNEvents, NinchatEmbedRNEvent} from 'ninchat-rn-sdk';Use NinchatEmbedRN as standard RN component passing config object structured in the same way as for web embed version.
const handleEmbedEvent = (event: NinchatEmbedRNEvents) => {
if(event.event === NinchatEmbedRNEvent.ActivityCount){
console.log('Activity count event', event)
} else if(event.event === NinchatEmbedRNEvent.Route) {
console.log('Route Change event', event)
}
// other events handling can be added here
}
<NinchatEmbedRN
// environment="development" // "development or "production". "production" is default
// variant= "live" // "live" "stage". "live" is default
// devServerIp={192.168....} // by default production mode is used so devServerIp is not needed. DevServerIp can be set for developmemnt mode, to have all urls pointing to specific machine IP
onEvent={handleEmbedEvent}
config = {{
configKey: '123',
config: {
default: {
audienceRealmId: '123', // used realm
variant: 'queue', // 'app' or 'queue'
...
}
},
}
}
/>Release history
v1.1.0
- image lightbox
- ability to download image to device directly
