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 Cello for iOS is compatible with iOS 15 and up.SDK size
The size of Cello for iOS varies depending on your app’s configuration. For most installations, it’s around 3 MB in size.Setup
Install Cello to see and give your users the option to spread the word from your iOS app. The Cello for iOS library supports iOS 15+ and requires Xcode 14 to build.Install Cello
Option 1: CocoaPods
Using the latest version of Cocoapods, add CelloSDK to your Podfile and runpod install
Option 2: Swift Package Manager
Add https://github.com/getcello/cello-ios-sp as a Swift Package Repository in Xcode and follow the instructions to add CelloSDK as a Swift Package.
Option 3: Install Cello manually
- Download Cello for iOS and extract the zip. (👉 Cello iOS zip download)
- Drag
CelloSDK.xcframework
into your project. Make sure Copy items if needed is selected and click Finish. - In the target settings for your app, set the
CelloSDK.xcframework
to Embed & Sign in the Frameworks, Libraries, and Embedded Content section of the General tab.
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: Available environments:prod
(Production)sandbox
(Sandbox)
Default environment: prod
Configuration Steps
- Open your iOS project in Xcode.
-
Navigate to the
Info.plist
file. -
Add a new key-value pair:
-
To switch to sandbox, change the string value to
sandbox
. - Save your changes. The next build will use the selected environment.
Initialize Cello
You’ll need your product ID and a user-specific token (similar to the web-based Referral component flow):Customize the Cello Referral Component
The Cello SDK 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
-
Default launcher: Use
Cello.showFab()
to present a pre-styled Floating Action Button (FAB). -
Custom launcher: Use any UI element (button, menu item, gesture) and call
Cello.openWidget()
when you want to open it.
Advanced: Custom Callbacks
For even more control, you can implement your own delegate conforming to theCelloDelegate
protocol. This allows you to get callbacks for significant events in the Referral component.
iOS API
Cello.initialize()
Initializes the Cello referral component.Name | Type | Description | Required |
---|---|---|---|
productId | string | Identifier of the product your users will refer. Found in your Cello Portal. | Yes |
token | string | Access token generated for the given user. | Yes |
productUserDetails | Cello.productUserDetails | Product User details | No |
completion | callback | Receives success or failure with configuration or error. |
Cello.showFab()
Shows the Floating action button or bookmark that launches the Referral ComponentCello.hideFab()
Hides the Floating action button or bookmark that launches the Referral ComponentCello.openWidget()
Opens the referral component.Cello.hideWidget()
Hides the referral component.Cello.getActiveUcc()
A method to get an activeucc
and invite link for the currently logged in user.
getCampaignConfig()
Returns campaign config values for the currently logged-in user.
Returns
The campaign config object: