Platform SDKs
Find SDK installation guides for iOS, Android, React Native, and Flutter.
Platform SDKs
Setgreet provides native SDKs for the four major mobile platforms. Each SDK is published on GitHub with full installation and integration documentation.
Supported platforms
| Platform | Language | Minimum version | Installation | Repository |
|---|---|---|---|---|
| iOS | Swift | iOS 15.0+ | Swift Package Manager, CocoaPods | setgreet-ios-sdk |
| Android | Kotlin | Android 6.0+ (API 23) | Maven Central (Gradle) | setgreet-android-sdk |
| React Native | TypeScript | React Native 0.74+ | npm / yarn | setgreet-react-native-sdk |
| Flutter | Dart | Flutter 3.27+ | pub.dev | setgreet-flutter-sdk |
Quick installation
iOS (Swift Package Manager)
In Xcode, add a Swift package with the URL:
https://github.com/setgreet/setgreet-ios-sdk.gitOr add it to your Package.swift:
dependencies: [
.package(url: "https://github.com/setgreet/setgreet-ios-sdk.git", .upToNextMajor(from: "LATEST_VERSION"))
]Android (Gradle)
Add the dependency to your app-level build.gradle.kts:
dependencies {
implementation("com.setgreet:setgreet:LATEST_VERSION")
}React Native (npm)
npm install @setgreet/react-native-sdkOr with yarn:
yarn add @setgreet/react-native-sdkThe SDK works with both the New Architecture and the old architecture. It follows your app's setting, with nothing to configure.
Flutter (pub.dev)
Add to your pubspec.yaml:
dependencies:
setgreet: ^LATEST_VERSIONThen run:
flutter pub getInitialization
After installing the SDK, initialize it on app launch with your App Key (found in the dashboard in your app's settings):
// iOS - in AppDelegate or App init
Setgreet.shared.initialize(appKey: "your_app_key", config: SetgreetConfig(debugMode: false))// Android - in Application.onCreate()
Setgreet.initialize(context, "your_app_key", SetgreetConfig(debugMode = false))// React Native - in App.tsx or index.js
import { initialize } from '@setgreet/react-native-sdk';
initialize('your_app_key');// Flutter - in main.dart
import 'package:setgreet/setgreet.dart';
await Setgreet.initialize('your_app_key');Each GitHub repository contains a complete integration guide with detailed setup instructions, example projects, and troubleshooting tips. Start there for platform-specific guidance.
Lottie animations (optional)
With CocoaPods (native iOS, React Native and Flutter), a missing or incomplete Podfile setup can build, then crash at
launch with dyld: Library not loaded: @rpath/Lottie.framework/Lottie. Follow the complete Podfile in the
iOS, React
Native or
Flutter README, and merge its
pre_install and post_install lines into the blocks your Podfile already has (a Podfile allows one of each).
Lottie support is opt-in on iOS, so apps that don't use it keep a smaller build. Without it, a Lottie component in a flow shows nothing on iOS; the rest of the flow is unaffected. On Android, Lottie is part of the core SDK and needs no setup.
To enable it on iOS:
- iOS (native): add the
SetgreetSDKLottiemodule and callSetgreetLottie.register()at startup. With Swift Package Manager, add theSetgreetSDKLottieproduct and theLottieproduct fromlottie-spm; nothing else is needed. With CocoaPods, addpod 'SetgreetSDKLottie'and the Podfile lines below. See the iOS SDK README. - React Native: add
pod 'RNSetgreet/Lottie'toios/Podfile, then callregisterLottie()at startup. Its:pathmust be the same path autolinking uses forRNSetgreet(listed underEXTERNAL SOURCESinPodfile.lock); the README resolves it withnodeinstead of hard-codingnode_modules. - Flutter: add
pod 'setgreet/Lottie', :path => '.symlinks/plugins/setgreet/ios'toios/Podfile, then callawait Setgreet.registerLottie()at startup.
// iOS (native)
import SetgreetSDKLottie
SetgreetLottie.register()// React Native
import { registerLottie } from '@setgreet/react-native-sdk';
registerLottie();// Flutter
await Setgreet.registerLottie();Call it once, before the first flow shows. On React Native and Flutter, registerLottie() returns false on iOS when the Lottie pod is not installed, and always true on Android.
The Lottie module loads lottie-ios as a dynamic framework built with library evolution, so CocoaPods apps (native
iOS, React Native and Flutter) also need a few Podfile lines for lottie-ios. The React
Native and
Flutter READMEs have the complete
Podfile for those platforms.
For a native iOS app using CocoaPods, add these lines to your Podfile, merging them into its pre_install and post_install blocks if it already has them (a Podfile allows one of each), then run pod install:
target 'YourApp' do
pod 'SetgreetSDK', '~> LATEST_VERSION'
pod 'SetgreetSDKLottie', '~> LATEST_VERSION'
end
# Build lottie-ios as a dynamic framework
# (needed when your Podfile has no use_frameworks!, or uses static linkage)
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name == 'lottie-ios'
def pod.build_type
Pod::BuildType.dynamic_framework
end
end
end
end
# Build lottie-ios with library evolution
post_install do |installer|
installer.pods_project.targets.each do |target|
next unless target.name == 'lottie-ios'
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
endWhat each SDK includes
All platform SDKs share the same core capabilities:
- Flow rendering -- fully native UI components with flexbox layout.
- User identification --
identifyUserwith user attributes, andresetUser. - Event tracking -- custom events (
trackEvent) and screen views (trackScreen). - Trigger and condition evaluation -- flow triggers and Condition nodes are evaluated server side, so targeting rules and Yes/No splits take effect without an app release.
- Analytics collection -- automatic tracking of views, completions, and interactions.
- Queued analytics -- events are persisted and retried when the network is unavailable. Flows themselves are not cached offline and need a live request to display.
- Flow callbacks -- lifecycle events for integrating with your app logic.
Next steps
- User Identification -- learn how to identify users and set attributes.
- Event Tracking -- track custom events for triggering and analytics.
- Displaying Flows -- control how and when flows appear.