Getting started
This guide will help you set up the Ada React Native SDK in your app. The process involves three main steps:
- Complete prerequisites: Ensure all necessary configurations and installations are done.
- Install the SDK: Add the SDK manually to your project.
- Launch Ada: Choose one of the available options to display Ada, such as using the
AdaEmbedView
component.
Follow the instructions below to install the SDK and start integrating Ada into your app!
Before you begin
The Ada React Native SDK is based on react-native-webview. Before using the SDK, you must do the following:
- Complete the react-native-webview Getting Started Guide.
- Ensure that you’re using react-native-webview version 11.2.0 or greater. The React Native SDK uses
allowUniversalAccessFromFileURLs
from the later versions of this module. - To support developing and testing locally, ensure that you temporarily add
http://localhost:8081/
to your Approved Domains. Without doing this the bot will be blocked by the Content Security Policy.
Once you’ve configured react-native-webview, simply install the Ada React Native SDK via NPM.
Install React Native SDK
- Use one of the following options to install Ada React Native SDK via NPM:
- With npm:
npm install --save @ada-support/react-native-sdk
- With yarn:
yarn add @ada-support/react-native-sdk
- With npm:
- Update your iOS Podfile to include the following import:
require_relative '../node_modules/@ada-support/react-native-sdk/react_native_pods'
- Update your iOS Podfile to include the following piece of code. This will import any required native modules in the React Native SDK.
use_ada!()
- Run
pod install
in your app to install the required native modules.
Launch
Once you have installed the Ada React Native SDK, you’re ready to use it in your app! Simply import the AdaEmbedView
component, then render it. Note that you must pass a valid handle
for the Chat window to work.
File permissions
Some functionality in the Ada Chat bot will not work unless permissions are explicitly given.
React Native iOS permissions
For iOS, specify the permissions in your ios/[project]/Info.plist
file.
React Native Android permissions
For Android, add permissions in AndroidManifest.xml
.