The Channel Talk React Native SDK is a plugin facilitating the installation of real-time customer chat into React Native applications. If you intend to install it into a web view or a mobile web, please refer to the JavaScript SDK Installation Guide.
Execute the following command in the shell to install the SDK.
The SDK includes a list of versions that are compatible with the mobile SDK. To verify that the version you have installed is compatible, please refer to the version compatibility.
You can install the SDK through CocoaPods, Carthage.
You can use CocoaPods to install Channel Talk iOS SDK. The minimum requirements for installation are as follows:
Xcode 12 or later
CocoaPods 1.10.0 or later
Run the
pod installcommand in the directory wherePodfileis located to install the package. If it is already installed, run thepod update.open
Project_Name.xcworkspace.
You can utilize Carthage to install Channel Talk iOS SDK.
Add ChannelIOSDK to the
Cartfileof the project as below.
If you need to install a specific package version, modify the script accordingly.
Execute the
carthage updatecommand in the directory whereCartfileis located to install the package. For Example:
carthage update -platform iOS --use-xcframeworksThe ChannelIOSDK package is built inside the
PROJECT_DIR/Carthage/builddirectory. Drag this package to Xcode to add it.
Several additional settings are required.
The following permissions are required to use the SDK. Add the key value and description below to the project's info.plist.
Key | Value |
|---|---|
Privacy-Camera Usage Description | Accessing the camera in order to provide a better user experience |
Privacy-Photo Library Additions Usage Description | Accessing to photo library in order to save photos |
Privacy-Microphone Usage Description | Accessing to microphone to record voice for video |
Initialize the SDK to prepare for use.
Go to AppDelegate.swift and add the initialize method below.
If you manage window instance on SceneDelegate.swift, You should add initializeWindow as shown below.
Go to AppDelegate.m and add the initialize method below.
If you manage window instance on SceneDelegate.m, You should add initializeWindow as shown below.
Declare our Maven repository to the build.gradle:
buildscript {
...
repositories {
...
google()
mavenCentral()
maven {
url 'https://maven.channel.io/maven2'
name 'ChannelTalk'
}
...
}
...
}If a build error occurs, please add the dependency to the app level build.gradle.
dependencies {
implementation 'io.channel:plugin-android'
}To use the Channel Talk SDK, you must call ChannelIO.initialize() in Application#onCreate().
If you haven't separately created your app's Application, create a new one.
Add the code below based on the language used in your project.
In Android API level 28 or above, an insecure HTTP connection is prohibited by default. If an HTTP URL is delivered during a conversation, the WebView embedded in the SDK cannot show the web page. The best way to resolve the issue is to deliver HTTPS URLs consistently. However, if your team needs to deliver an HTTP URL, change AndroidManifest.xml properties as follows:
import the SDK wherever you intent to use it.
Boot is the preparation process for using the SDK.
You may require your channel’s plugin key. See how to get a plugin key. There are two types of Boot: Boot as an anonymous user or Boot as a member user.
For a detailed description of the user, see Member User.
An anonymous user is a user without a memberId. The following is an example of Boot with an anonymous user and how to receive the Boot result value.
A member user is a user with a memberId property. If the user can be identified independently, such as when signed in to your service, you can boot as a member user by providing a memberId. Channel distinguishes a user by the memberId field.
Use member hash to protect sensitive information of your users
If you set the memberId using predictable values such as a user ID or email, an unauthorized third party might acquire your user’s memberId. This unauthorized access might allow the malicious third party to obtain your user’s sensitive information, including their mobile number and chat logs, which could lead to a security breach. Enable member hash for your channel to improve the security level.
The following is an example of boot a member user with a specific memberId.
Do not selectively call functions that display the SDK screen, such as ChannelIO.showMessenger or ChannelIO.showChannelButton, by checking the boot status (BootStatus).
The SDK internally checks the boot status for these features. As of version 0.11.11, the SDK automatically provides an appropriate guidance screen to your users if the current SDK version is no longer supported due to a future update. If you selectively call these functions, this necessary user experience will not be provided, which can disrupt the experience for customers using unsupported versions.
The SDK provides a default Channel button to launch messengers. You can call showChannelButton and hideChannelButton to show or hide Channel buttons.
If you want to change the button’s appearance, see how to customize the Channel button.
It can be used when you only want to use event tracking via track or push notifications. Features such as chat support or marketing pop-ups will not function.
Terminates all features of the SDK. If you want to use the feature of SDK again, you need to Boot it once more.