Installation
Overview
Kommunicate provides open source live chat sdk in capacitor which works with both Ionic apps. Kommunicate lets you add real time live chat, in-app messaging and bot integration in your mobile applications and website for customer support.
Signup at https://dashboard.kommunicate.io/signup to get the Application ID.
Installation
Add the plugin as below
npm install capacitor-plugin-kommunicate
Since this plugin uses native modules for android and ios, add them as below. Ignore if the android and iOS modules exist in your project
npx cap add android
npx cap add ios
Android
Open the android module in android studio as below
npx cap open android
Register the plugin in your android/app/java/<App-Package>/MainActivity.java
file as below:
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(KommunicateCapacitorPlugin.class); //append this line
}});
iOS
Navigate to <Your-Project>/ios/App
directory and run the below command
pod install
Open the iOS project in xcode as below
npx cap open iOS
Import the plugin
Import the plugin in the file where you would like to call the kommunicate functions as below
import 'capacitor-plugin-kommunicate';
import { Plugins } from '@capacitor/core';
const { KommunicateCapacitorPlugin } = Plugins;
Now start calling the functions from KommunicateCapacitorPlugin
.
Note: After any code changes in your project's .ts or .js files, run the below commands
npm run build
npx cap sync
For Android and iOS run the project fron Android Studio and Xcode respectively. For web, use the command
ionic serve
.