Installation
A basic installation takes around 15 minutes, but will take a little longer if you want to customize the way the Cello Referral Component is launched. Compatibility- The Cello React Native wrapper supports React Native 0.59 and above.
- Cello for iOS supports iOS 15+.
- Cello for Android supports API 21+.
Install Cello
Android Setup
Automatic Linking (RN v0.60+)
Library is automatically linked after installation.React Native v0.59 (Automatic Linking)
React Native v0.59 (Manual Linking)
android/settings.gradle
android/app/build.gradle
Android Initialization
Update yourMainApplication.java
:
android/app/src/main/AndroidManifest.xml
:
iOS Setup
Automatic Linking (RN v0.60+)
Library links automatically afterpod install
.
Manual Linking (RN v0.59)
- Open
.xcworkspace
or.xcodeproj
. - Insert the
CelloSDK.xcframework
into your project (enable “Copy items if needed”). - In target settings, set it to Embed & Sign under Frameworks, Libraries, and Embedded Content.
iOS Initialization
InAppDelegate.m
, add:
didFinishLaunchingWithOptions
you’ll need to initialize Cello. Add the snippet below using the productId
and token
Choose an Environment
In your Cello SDK setup, you have the flexibility to select the environment in which your application will run. This feature is especially useful for different stages of development, such as testing in a development or staging environment before going live in production. The available environments are:prod
(Production) (default)sandbox
(Sandbox)
Using Cello with Expo
If you are using Expo, you can use the built-in plugin. After installing the @getcello/cello-react-native package, add the config plugin to theplugins
array of your app.json
or app.config.js
:
prebuild
) the native app. If no extra properties are added, defaults will be used.
env
(string): Set to your desired environment, such asprod
,sandbox
. Optional. Defaults toprod
.
Customize the Cello Referral Component
The Cello React Native allows for various levels of customization to better fit into your app’s design and flow. One of the main components you might want to customize is the Referral componentChoose Your Launcher
The library provides two ways to launch the Referral component: Default launcher If you choose to go with the default launcher, you can call theshowFab()
method from the Cello library to present a Floating Action Button (FAB) within your app. This FAB is pre-styled but may not perfectly match your app’s look and feel.
Cello.openWidget()
.
React Native API
Cello.initialize(InitializeOptions): Promise<Configuration>
Initializes the Cello referral component.
InitializeOptions
Property | Type | Required | Description |
---|---|---|---|
productId | string | yes | Your product ID from Cello Portal |
token | string | yes | User authentication token |
productUserDetails | ProductUserDetails | no | User details object (see below) |
ProductUserDetails
Optional object with user information:Property | Type | Description |
---|---|---|
firstName | string | User’s first name |
lastName | string | User’s last name |
fullName | string | User’s full name |
string | User’s email address |
Cello.showFab(): void
Shows the default Cello button that launches the Referral Component
Cello.hideFab(): void
Hides the default Cello button that launches the Referral Component
Cello.openWidget(): void
Opens the referral component.
Cello.hideWidget(): void
Hides the referral component.
Cello.getActiveUcc(): Promise<{ ucc: string; inviteLink: string; } | null>
A method to get an active ucc
and invite link for the currently logged in user.