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
andnvm 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:
Access the directory where the server sample is deployed.
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:
Change the application directory.
Enter the following commands:
cd app nvm use npm install bundle install npx pod-install
Update the company information:
src/screens/Home.tsx: Update the parameters in
UJET.initialize({})
android/app/src/main/res/values/strings.xml: Update
ujet_company_key
,ujet_subdomain
, andujet_company_url
.
Enter the command
npm start
.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:
Copy the following files from the sample app and paste them into your project where appropriate:
app/src/native_modules/UJETInterfaces.ts
app/src/native_modules/UJETNativeModule.ts
app/ios/UJETModule.h
app/ios/UJETModule.m
app/android/src/main/java/com/sampleapp/UJETModule.kt
Open
UJETNativeModule.ts
Remove the following line:
import AsyncStorage from '@react-native-async-storage/async-storage';
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' } }
Update SIGNING_BASE_URL to point to your signing endpoint.
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: