Flutter
We rely on Pub.dev to distribute our Flutter SDK
Main dependency
flutter pub add purchasely_flutter:6.0.0-rc.1Don't forget to change the minimum OS versions to match Purchasely requirements (iOS 13.4 / Android 23)
// Podfile
...
platform :ios, '13.4'
...// Edit file android/build.gradle
buildscript {
ext {
minSdkVersion = 23 //min version must not be below 23
compileSdkVersion = 36
targetSdkVersion = 35
}
}
allprojects {
repositories {
mavenCentral()
}
}Android setup
We do include a store by default in our SDK, with Android you can choose to use Google and/or Huawei and/or Amazon.
See below to add the store you want to use
VersioningAll your dependencies must always be at the exact same version. Pin each package to
6.0.0-rc.1— do not use a floating range (^6.0.0,5.+, …).dependencies: purchasely_flutter: 6.0.0-rc.1 purchasely_google: 6.0.0-rc.1 purchasely_android_player: 6.0.0-rc.1
Google Play Billing
To add Google as a store, you can use our pub.dev dependency
flutter pub add purchasely_google:6.0.0-rc.1Then you must add Google in the list of stores when starting the SDK with the builder
await Purchasely.apiKey('X-API-KEY')
.runningMode(PLYRunningMode.full)
.logLevel(PLYLogLevel.error)
.stores([PLYStore.google]) // don't forget to add the matching dependency at the same version
.storekitVersion(PLYStorekitVersion.storeKit2) // iOS only: storeKit2 (default) | storeKit1
.start();Google Play Billing v8
If you use Google Play Billing in version 8, please read this to make it work with Purchasely
Video Player
A video player is not provided by default on Android to avoid conflict with another dependency you may have
We provide one in an external dependency that is detected and handled automatically
flutter pub add purchasely_android_player:6.0.0-rc.1Other stores
Our Flutter SDK does not contains other stores to avoid unnecessary integrations. You have to specifically declare which stores you want. To add our stores dependencies to your project, you just need to add them to the app/build.gradle file of your android folder in your project. The version must be the same than purchasely main dependency
dependencies {
//Amazon App Store
implementation 'io.purchasely:amazon:6.0.0-rc.1'
//Huawei Mobile Services
implementation 'io.purchasely:huawei-services:6.0.0-rc.1'
}