Android Installation
STEP 1: Add the Jitpack repository to Gradle's dependency resolution
Your Branding Brand account manager can provide your unique App ID.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}
STEP 2: Add Flagship™ SDK to your Gradle dependencies
In app/build.gradle:
implementation 'com.github.brandingbrand:Flagship-Android-SDK:v1.15.0'
STEP 3: Add your Flagship App ID to AndroidManifest.xml
<meta-data android:name="FlagshipAppID" android:value="YOUR_APP_ID" />
STEP 4: Add declarations for FlagshipActivity
In AndroidManifest.xml:
<activity android:name="com.brandingbrand.flagshipsdk.ui.FlagshipActivity" />
STEP 5: Initialize Flagship™ in MainApplication
import com.brandingbrand.flagshipsdk.FlagshipService
class MainApplication : Application(){
override fun onCreate() {
super.onCreate()
FlagshipService.getShared().initWithApplication(this)
}
}That's it. You're done! Next, you'll want to display a feed and consider managing the user profile to personalize the user experience.
iOS Installation
STEP 1: Add Flagship™ SDK to your project
Option A: CocoaPods
Add the following to your Podfile:
pod 'FlagshipSDK',
:podspec => 'https://cdn.brandingbrand.com/flagship-sdk/ios/v1.15.0/FlagshipSDK.podspec'
Option B: Swift Packages
Add a new Swift Package to your project from the following repository:
git@github.com:brandingbrand/flagship-ios-sdk-swift-package.gitYou can either specify the main branch to always get the latest version, or specify a version or version range such as 1.10.1.
STEP 2: Add your Flagship App ID to your Info.plist
Add a new property to Info.plist named FlagshipAppID with a type of String. Your Branding Brand account manager can provide your unique App ID.
That's it. You're done! Next, you'll want to display a feed and consider managing the user profile to personalize the user experience.
React Native Installation
STEP 1: Add Flagship™ SDK to package.json
React Native's new autolinking scheme requires native packages to exist in a project's top-level package.json in order to be linked.
"dependencies": {
"@brandingbrand/flagship-sdk": "^1.15.0"
...
}
STEP 2: Add Required Dependencies
"dependencies": {
"@brandingbrand/react-native-dynamic-fonts": "*",
"@brandingbrand/react-native-pager-view": "*",
"@react-native-async-storage/async-storage": "*",
"react-native-device-info": "*",
"react-native-fs": "*",
"react-native-localize": "<3",
"react-native-svg": "<14",
"react-native-video": "<6",
"react-native-webview": "*"
...
}
STEP 3: Initialize Flagship
Initialize Flagship and provide your App ID and optional callback functions to handle events. Your Branding Brand account manager can provide your unique App ID. The initializer will return a component to display a feed and an object to manage user profiles.
import Flagship from '@brandingbrand/flagship-sdk';
const { FlagshipFeed, FlagshipStory, FlagshipService } = Flagship({
appId: 'YOUR_APP_ID',
// Optional - provide your event handlers
handleShowStory: YOUR_SHOW_STORY_HANDLER,
handleCloseStory: YOUR_CLOSE_STORY_HANDLER,
handleDeepLink: YOUR_DEEPLINK_HANDLER,
handleAnalytics: YOUR_ANALYTICS_HANDLER,
handleError: YOUR_ERROR_HANDLER
});
That's it. You're done! Next, you'll want to display a feed and consider managing the user profile to personalize the user experience.
