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, CocoaPodssetgreet-ios-sdk
AndroidKotlinAndroid 6.0+ (API 23)Maven Central (Gradle)setgreet-android-sdk
React NativeTypeScriptReact Native 0.74+npm / yarnsetgreet-react-native-sdk
FlutterDartFlutter 3.27+pub.devsetgreet-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)

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"))
]

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.

Flutter (pub.dev)

Add to your pubspec.yaml:

dependencies:
  setgreet: ^LATEST_VERSION

Then run:

flutter pub get

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 pod 'SetgreetSDKLottie' and the Podfile lines below. See the iOS SDK README.
  • React Native: add pod 'RNSetgreet/Lottie' to ios/Podfile, then call registerLottie() at startup. Its :path must be the same path autolinking uses for RNSetgreet (listed under EXTERNAL SOURCES in Podfile.lock); the README resolves it with node instead of hard-coding node_modules.
  • Flutter: 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 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
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