Channel Developers

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.

Shell

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

  1. Run the pod install command in the directory where Podfile is located to install the package. If it is already installed, run the pod update.

  2. open Project_Name.xcworkspace.

You can utilize Carthage to install Channel Talk iOS SDK.

  1. Add ChannelIOSDK to the Cartfile of the project as below.

Ruby

If you need to install a specific package version, modify the script accordingly.

Ruby
  1. Execute the carthage update command in the directory where Cartfile is located to install the package. For Example:

Plaintext
carthage update -platform iOS --use-xcframeworks
  1. The ChannelIOSDK package is built inside the PROJECT_DIR/Carthage/build directory. 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.

Swift

If you manage window instance on SceneDelegate.swift, You should add initializeWindow as shown below.

Swift

Go to AppDelegate.m and add the initialize method below.

Objective-C

If you manage window instance on SceneDelegate.m, You should add initializeWindow as shown below.

Objective-C

Declare our Maven repository to the build.gradle:

Plaintext
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.

Plaintext
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.

Kotlin
Java

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:

XML

import the SDK wherever you intent to use it.

JavaScript

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.

JavaScript

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.

JavaScript

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.

JavaScript

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.

JavaScript

Terminates all features of the SDK. If you want to use the feature of SDK again, you need to Boot it once more.

JavaScript