Installing the SDKs
How to add AppFig to your project on each platform. The SDKs are published at github.com/smartconfigui/AppFig-SDKs; the current version is 2.5.0.
iOS
Minimum: iOS 12.
Swift Package Manager
- In Xcode: File > Add Package Dependencies
- Enter the URL:
https://github.com/smartconfigui/AppFig-SDKs - Choose version
2.5.0or later and add the AppFigSDK library to your app target.
CocoaPods
Add to your Podfile, then run pod install:
pod 'AppFigSDK', :git => 'https://github.com/smartconfigui/AppFig-SDKs.git', :tag => 'v2.5.0'
The pod is installed from the Git repository; it is not on the CocoaPods trunk, so
pod 'AppFigSDK' without :git will not find it.
Import
import AppFigSDK
The class you call is AppFig; the module you import is AppFigSDK.
Updating from 2.0.0 or earlier with a manually added framework
The framework was renamed from AppFig.xcframework to AppFigSDK.xcframework so that
its name matches its module. If you added the framework to Xcode by hand, remove the old
one and add ios/AppFigSDK.xcframework. Your code does not change.
Android
Minimum: Android 5.0 (API 21).
- Add the dependency to your app module (
build.gradle):Independencies { implementation 'com.appfig:appfig-android:2.5.0' }build.gradle.kts:implementation("com.appfig:appfig-android:2.5.0"). - Import:
import com.appfig.sdk.AppFig
The SDK is on Maven Central, which a standard Android project already has in its
repositories (mavenCentral()). Projects that installed it from JitPack
(com.github.smartconfigui:AppFig-SDKs) keep working; use one or the other, not both.
The libraries the SDK needs (OkHttp, Gson, the Kotlin standard library) are pulled in automatically.
Flutter
Minimum: Android 5.0 (API 21), iOS 12.
Add to pubspec.yaml:
dependencies:
appfig_flutter:
git:
url: https://github.com/smartconfigui/AppFig-SDKs.git
path: flutter
ref: v2.5.0
import 'package:appfig_flutter/appfig_flutter.dart';
await AppFig.init(companyId: 'your-company', tenantId: 'your-app', env: 'prod', apiKey: 'your-api-key');
final value = await AppFig.getFeatureValue('my_feature');
The package uses the native Android and iOS SDKs underneath, so nothing else has to be added to the Android or iOS projects. It is installed from Git; it is not on pub.dev.
Unity
Minimum: Unity 2021.3.
In Unity: Window > Package Manager > + > Add package from git URL, then enter:
https://github.com/smartconfigui/AppFig-SDKs.git?path=/unity#v2.5.0
The tag at the end pins the version; change it to update. The same address works as a line
in Packages/manifest.json: "com.appfig.sdk": "<that address>". The SDK works in Mono and
IL2CPP builds, including with Managed Stripping Level set to High.
On older Unity versions, download unity/AppFigUnitySDK.dll from the
SDK repository and place it
in Assets/Plugins/AppFig/ instead. See the Unity guide.
React / Web
Download react/AppFigReactSDK.js and react/AppFigReactSDK.d.ts from the
SDK repository and add them
to your project:
import AppFig from './AppFigReactSDK';
See the React/Web guide.