Installation
This is the installation doc for the Kommunicate SDK for React Native.
To add the Kommunicate module to you react native application, add it using npm:
npm install react-native-kommunicate-chat --save
Navigate to YourApp/ios directory from terminal and run the below command:
pod install
Note: Kommunicate requires min ios platform version 13 and uses dynamic frameworks. Make sure you have the below settings at the top of your Podfile:
platform :ios, '13.0'
use_frameworks!
Import the module
You can use the module by importing it in your react native files as below:
import RNKommunicateChat from 'react-native-kommunicate-chat';
In the latest react native version above import statement might create a build issue. In that case, import the module using the following code:
var RNKommunicateChat = NativeModules.RNKommunicateChat;
Get your App Id
Sign up for Kommunicate to get your APP_ID. This APP_ID is used to create/launch conversations.
Launch chat
Kommunicate provides buildConversation function to create and launch chat directly saving you the extra steps of authentication, creation, initialization and launch. You can customize the process by building the conversationObject according to your requirements.
To launch the chat you need to create a conversation object. This object is passed to the buildConversation
function and based on the parameters of the object the chat is created/launched.
Please look into [Conversation Section] (https://docs.kommunicate.io/docs/reactnative-conversation) for some sample flows.