Mobile SDK

The CCAI Platform Mobile SDKs let you provide voice and chat support for your customers directly inside your iOS or Android mobile application.

iOS and Android SDK

The CCAI Platform mobile SDKs are available for iOS and Android. Guides are available for providing information on how to use the Android mobile SDK and iOS mobile SDK.

React Native

This section shows how to use React Native.

Run the Sample Application Locally

It is possible to run the provided sample application locally. To do this, you need the following:

  • Homebrew

  • Node Version Manager: Run brew install nvm, then read the resulting message to add the required code snippets to your shell profile.

  • Node.js: In the project root, run nvm install and nvm use to ensure that you're working with the correct version.

Run the Local Server

The provided sample application can also be served from a local server. To implement this, follow these steps:

  1. Access the directory where the server sample is deployed.

  2. Enter the following commands:

    cd server
    cp .env.example .env
    Edit .env
    nvm use
    npm install
    npm start```
    

Run React Native

To run React Native, follow these steps:

  1. Change the application directory.

  2. Enter the following commands:

    cd app
    nvm use
    npm install
    bundle install
    npx pod-install
    
  3. Update the company information:

    1. src/screens/Home.tsx: Update the parameters in UJET.initialize({})

    2. android/app/src/main/res/values/strings.xml: Update ujet_company_key, ujet_subdomain, and ujet_company_url.

  4. Enter the command npm start.

  5. Run the iOS or Android mobile application using either the Meteor interactive CLI or an IDE of your choice.

Import the CCAI Platform module to your project

This section shows you how to import the CCAI Platform module to your project.

Requirements

You need to use a JWT signing API endpoint. Refer to the server/app.js file in the Sample App, or see End User Authentication for more details.

Procedure

To import the CCAI Platform module into your project, follow these steps:

  1. Copy the following files from the sample app and paste them into your project where appropriate:

    1. app/src/native_modules/UJETInterfaces.ts
    2. app/src/native_modules/UJETNativeModule.ts
    3. app/ios/UJETModule.h
    4. app/ios/UJETModule.m
    5. app/android/src/main/java/com/sampleapp/UJETModule.kt
  2. Open UJETNativeModule.ts

    1. Remove the following line:

      import AsyncStorage from '@react-native-async-storage/async-storage';

    2. Edit the getUserData function to return accurate end user information:

      async function getUserData({ name: anonymousName }: SignPayloadData): Promise<Object> {
        // fetch the end user information from your application
        return {
          name: 'John Doe',
          identifier: 'id1234',
          email: 'jdoe@example.com',
          phone: '+12223334444'
        }
      }
      
    3. Update SIGNING_BASE_URL to point to your signing endpoint.

  3. Initialize and start, using the following code example:

    import { UJET } from '../path/UJETNativeModule';
    
    UJET.initialize({
      key: 'your-key',
      baseUrl: 'your-base-url'
    });
    
    const startUJET = () => {
      UJET.start({
        skipSplashScreen: true
      });
    };
    

Specific platform integrations

To continue the React Native integration process, see the following documents, depending on your platform: