Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 3.96 KB

1.0.0-beta.3-MIGRATION.md

File metadata and controls

71 lines (48 loc) · 3.96 KB

1.0.0-beta.3 API Changes

This latest release updates the Android SDK dependency from v7 to v8 to use BillingClient 7 and updates the iOS SDK dependency from v4 to v5 to use StoreKit 2 by default in the SDK.

If you're coming from KobanKat, make sure you follow the KobanKat migration guide first.

In-App Purchase Key Required for StoreKit 2

Caution

You must configure your In-App Purchase Key in the RevenueCat dashboard. Purchases will fail if the key is not configured. This is a new requirement for all RevenueCat SDKs.

Migration Guides

New Minimum OS Versions

This release raises the minimum required OS versions to the following:

  • iOS 13.0
  • Android: SDK 21 (Android 5.0)

Specifying StoreKit version with storeKitVersion (iOS Only)

When configuring the SDK, you may specify which StoreKit version storeKitVersion: StoreKitVersion value. It defaults to letting the iOS SDK determine the most appropriate version of StoreKit at runtime. If you'd like to use a specific version of StoreKit, you may provide a value for storeKitVersion like so:

val config: PurchasesConfiguration = PurchasesConfiguration(apiKey = {YOUR_API_KEY}) {
    storeKitVersion = StoreKitVersion.STOREKIT_2
}

Purchases.configure(config)

PurchasesAreCompletedBy Is Now a Sealed Interface

PurchasesAreCompletedBy is now a sealed interface instead of an enum, with two types: RevenueCat and MyApp. When specifying MyApp, you must now provide the StoreKit version you are using to process purchases on iOS. If your app is Android-only, you may provide any value since it is ignored on Android.

You can set purchasesAreCompletedBy to MyApp when configuring the SDK like so:

val configuration = PurchasesConfiguration(apiKey = {YOUR_API_KEY}) {
    purchasesAreCompletedBy = PurchasesAreCompletedBy.MyApp(StoreKitVersion.STOREKIT_2)
}
Purchases.configure(configuration)

Observing Purchases Completed by Your App with StoreKit 1

If purchases are completed by your app using StoreKit 1, you will need to explicitly configure the SDK to use StoreKit 1:

val configuration = PurchasesConfiguration(apiKey = {YOUR_API_KEY}) {
    purchasesAreCompletedBy = PurchasesAreCompletedBy.MyApp(StoreKitVersion.STOREKIT_1)
}
Purchases.configure(configuration)

Removal of Purchases.purchasesAreCompletedBy

The getter and setter on Purchases.sharedInstance.purchasesAreCompletedBy has been removed. Please reach out to us if this is something you've been using and need to continue using.

Other BC7 Additions (Android Only)

  • PurchasesConfiguration.pendingTransactionsForPrepaidPlansEnabled: Enable this setting if you want to allow pending purchases for prepaid subscriptions (only supported in Google Play). Note that entitlements are not granted until payment is done. Default is disabled.
  • SubscriptionOption.InstallmentsInfo: Type containing information of installment subscriptions. Currently only supported in Google Play.

Next steps

If you're migrating to the stable 1.0.0 or newer, make sure to follow the 1.0.0 migration guide next.

Reporting undocumented issues:

Feel free to file an issue! New RevenueCat Issue.