Skip to content
SDK

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

PlatformLanguageMinimum versionInstallationRepository
iOSSwiftiOS 15.0+Swift Package Manager (CocoaPods by podspec URL)setgreet-ios-sdk
AndroidKotlinAndroid 6.0+ (API 23)Maven Central (Gradle)setgreet-android-sdk
React NativeTypeScriptReact Native 0.74+npm / yarn; iOS SDK bundled (CocoaPods or Swift Package Manager)setgreet-react-native-sdk
FlutterDartFlutter 3.27+pub.dev; iOS SDK bundled (Swift Package Manager or CocoaPods)setgreet-flutter-sdk

Quick installation

Replace LATEST_VERSION in the snippets below with the current release. Each SDK publishes its version on its releases page: iOS, Android. For npm and pub.dev, the install commands already resolve to the latest published version.

iOS (Swift Package Manager)

Swift Package Manager is the primary way to add the iOS SDK. In Xcode, add a Swift package with the URL:

https://github.com/setgreet/setgreet-ios-sdk.git

Or add it to your Package.swift:

dependencies: [
    .package(url: "https://github.com/setgreet/setgreet-ios-sdk.git", .upToNextMajor(from: "LATEST_VERSION"))
]

iOS (CocoaPods)

CocoaPods projects install the SDK from the GitHub repository by podspec URL. The podspec points at the prebuilt framework at that release tag, so no pod registry is involved:

pod 'SetgreetSDK', :podspec => 'https://raw.githubusercontent.com/setgreet/setgreet-ios-sdk/LATEST_VERSION/SetgreetSDK.podspec'

Then run pod install. To update, change the version in the URL and run pod install again.

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-sdk

Or with yarn:

yarn add @setgreet/react-native-sdk

The SDK works with both the New Architecture and the old architecture. It follows your app's setting, with nothing to configure.

The package ships the native iOS SDK, so there is nothing to add for it in either dependency manager. With CocoaPods, autolinking installs the RNSetgreet pod; run cd ios && pod install. In React Native's Swift Package Manager mode (experimental, npx react-native spm), the package's Package.swift is picked up automatically. The React Native team does not recommend that mode for production apps yet, so CocoaPods remains the supported path until it does.

Flutter (pub.dev)

Add to your pubspec.yaml:

dependencies:
  setgreet: ^LATEST_VERSION

Then run:

flutter pub get

The plugin bundles the Setgreet iOS SDK, so there is nothing to add on either dependency manager. With Swift Package Manager (the default in Flutter 3.44 and later), the plugin's Swift package is resolved when you build or run the app. With CocoaPods, the same SDK is included as prebuilt frameworks inside the plugin; run cd ios && pod install.

Initialization

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 SetgreetSDKLottie module and call SetgreetLottie.register() at startup. With Swift Package Manager, add the SetgreetSDKLottie product and the Lottie product from lottie-spm; nothing else is needed. With CocoaPods, add the SetgreetSDKLottie podspec URL next to the core one and the Podfile lines below. See the iOS SDK README.
  • React Native: with CocoaPods, add pod 'RNSetgreet/Lottie' to ios/Podfile; its :path must be the same path autolinking uses for RNSetgreet (listed under EXTERNAL SOURCES in Podfile.lock), and the README resolves it with node instead of hard-coding node_modules. In Swift Package Manager mode, add two products to your app target in Xcode instead: SetgreetSDKLottie from setgreet-ios-sdk at the exact version the package's Package.swift pins, and Lottie from lottie-spm; no Podfile changes apply. Then call registerLottie() at startup.
  • Flutter: with Swift Package Manager, add two packages to the Runner target in Xcode (ios/Runner.xcworkspace, File > Add Package Dependencies): setgreet-ios-sdk with Exact Version set to the iOS SDK version the plugin bundles (the exact: line in the plugin's ios/setgreet/Package.swift), adding the SetgreetSDKLottie product, and lottie-spm from 4.6.0, adding the Lottie product; no Podfile changes are needed. With CocoaPods, add pod 'setgreet/Lottie', :path => '.symlinks/plugins/setgreet/ios' to ios/Podfile. Then call await 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 Lottie support is not in the app (neither the Lottie pod nor the SetgreetSDKLottie package product), 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
  # Both URLs must name the same version: the Lottie module requires that exact core build.
  pod 'SetgreetSDK', :podspec => 'https://raw.githubusercontent.com/setgreet/setgreet-ios-sdk/LATEST_VERSION/SetgreetSDK.podspec'
  pod 'SetgreetSDKLottie', :podspec => 'https://raw.githubusercontent.com/setgreet/setgreet-ios-sdk/LATEST_VERSION/SetgreetSDKLottie.podspec'
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
end

What each SDK includes

All platform SDKs share the same core capabilities:

  • Flow rendering -- fully native UI components with flexbox layout.
  • User identification -- identifyUser with user attributes, and resetUser.
  • 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

On this page