$ npm install react-native-kommunicate-chat --save
$ react-native link react-native-kommunicate-chat
-
Go to iOS directory from terminal and run the below command (Skip if the directory already has a Podfile): pod init
-
Open Podfile and add the below pod entry(inside your App target) :
pod 'Kommunicate', '~>2.2.0'
-
Then set the ios platform as 10 at the top of the Podfile (Skip if the platform is already set to 10 or above):
platform :ios, '10.0'
-
Then inside your app target in Podfile add the below line:
use_frameworks!
-
Then go to ios directory from terminal and run the below command:
pod install
-
Open YourApp.xcworkspace file in xcode from ios directory.
-
Change minimum iOS version in xcode for project (General -> Deployment Info -> Deployment Target - > 10)
-
Right Click on yourApp -> Add Files -> YourApp -> node_modules -> react-native-kommunicate-chat -> ios and add the two files -> RNKommunicateChat.swift and KommunicateChatBridge.m
-
While adding the above 2 files, you will be asked to generate the swift bridging header, click yes. Ignore if your project already has a bridging header file. In the bridging header.h file add the below 2 lines:
#import <React/RCTBridge.h> #import <React/RCTBridgeModule.h>
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import io.kommunicate.app.RNKommunicateChatPackage;
to the imports at the top of the file - Add
new RNKommunicateChatPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-kommunicate-chat' project(':react-native-kommunicate-chat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-kommunicate-chat/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':react-native-kommunicate-chat')