Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@ The changelog for `Superwall`. Also see the [releases](https://github.com/superw
## 2.8.0

## Enhancements

- Updates Google Play Billing Library from 8.0.0 to 9.1.0. See the [Play Billing Library 9 migration guide](https://developer.android.com/google/play/billing/migrate-gpblv9) for the full list of changes.
- Updates the RevenueCat SDK used by the sample apps from 9.2.0 to 10.14.1 for Billing 9 compatibility.
- Adds support for custom store products. Products configured on a custom store in the Superwall dashboard (e.g. Stripe or your own payment backend) can now be attached to paywalls: their metadata (price, subscription period, trial) is fetched from the Superwall API instead of Google Play and templated into the paywall like any other product. Purchases are routed through your `PurchaseController`, bypassing Google Play Billing entirely — check `product.isCustomProduct` to fulfill them via your own payment flow, and grant their entitlements with `Superwall.instance.setSubscriptionStatus(...)` on success. Requires configuring the SDK with a `PurchaseController`.
- Adds a unified `PurchaseController.purchase(activity, product: StoreProduct, basePlanId, offerId)` method that handles both Google Play and custom store products. For Play products, the underlying `ProductDetails` are available via `product.rawStoreProduct`.
- Custom purchases produce full transaction analytics (`transaction_start`/`transaction_complete`, `subscriptionStart`/`freeTrialStart`) with an SDK-generated transaction identifier exposed as `StoreProduct.customTransactionId`, and free-trial eligibility for custom products is derived from the customer's entitlement history.
- Renames `TestStoreProduct` to `ApiStoreProduct`, now shared between test mode and custom store products.

## Breaking Changes
- Removes the deprecated `SuperwallBillingFlowParams.Builder.setSkuDetails(SkuDetails)`. Billing Library 9 removes `SkuDetails` entirely, so this method can no longer exist. Use `setProductDetailsParamsList(...)` with `ProductDetails` instead.
- Removes the unused internal `com.superwall.sdk.billing.SWProduct`, which wrapped the now-removed `SkuDetails`.
- Internal purchase-history queries now resolve current purchases via `QueryPurchasesParams` — Billing Library 9 removes the purchase-history APIs (`queryPurchaseHistoryAsync`, `QueryPurchaseHistoryParams`).
- **Impact:** if your app still calls the removed Billing Library APIs (`SkuDetails`, `SkuDetailsParams`, `querySkuDetailsAsync`, `queryPurchaseHistoryAsync`, `BillingClient.SkuType`, or the no-arg `enablePendingPurchases()`), it will no longer compile once it picks up Billing 9 through this SDK. Migrate those call sites to the `ProductDetails` APIs before upgrading; the [migration guide](https://developer.android.com/google/play/billing/migrate-gpblv9) has a mapping of every removed API to its replacement.
- **Please test your billing and purchasing flows before shipping this upgrade.** Because the Billing Library is resolved to a single version across your app, upgrading Superwall also upgrades Billing for everything else that depends on it. If you use Google Play Billing directly, or another subscription provider such as RevenueCat, Adapty or Qonversion, make sure that provider's SDK supports Billing 9 and run through purchase, restore and subscription-status flows end to end.

## ⚠️ Minimum SDK version raised to 23

Google Play Billing Library 9 requires Android 6.0 (API 23), so the SDK's `minSdk` is now **23** (previously 21). If your app's `minSdk` is below 23, you'll need to raise it to pick up this release — devices on Android 5.x will no longer receive app updates that include this SDK version.

## Deprecations

- Deprecates `PurchaseController.purchase(activity, productDetails, basePlanId, offerId)` in favor of the `StoreProduct`-based method above. Existing implementations keep working unchanged — the new method's default implementation routes Google Play purchases to the deprecated one — but purchasing custom store products requires implementing the new method.
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {

defaultConfig {
applicationId = "com.superwall.superapp"
minSdk = 22
minSdk = 23
targetSdk = 34
versionCode = 2
versionName = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion example/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

defaultConfig {
applicationId = "com.superwall.superapp"
minSdk = 22
minSdk = 23
targetSdk = 34
versionCode = 1
versionName = "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
billing_version = "8.0.0"
billing_version = "9.1.0"
browser_version = "1.8.0"
gradle_plugin_version = "8.6.1"
jna_version = "5.14.0@aar"
kotlinxCoroutinesGuavaVersion = "1.9.0"
leakcanaryAndroidVersion = "2.14"
lifecycleProcessVersion = "2.8.5"
orchestratorVersion = "1.5.0"
revenue_cat_version = "9.2.0"
revenue_cat_version = "10.14.1"
compose_version = "2024.12.01"
kotlinx_serialization_json_version = "1.7.2"
activity_compose_version = "1.9.3"
Expand Down
2 changes: 1 addition & 1 deletion superwall-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
compileSdk = 35

defaultConfig {
minSdk = 22
minSdk = 23

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
2 changes: 1 addition & 1 deletion superwall/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ android {
namespace = "com.superwall.sdk"

defaultConfig {
minSdkVersion(21)
minSdkVersion(23)
targetSdkVersion(33)

aarMetadata {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package com.superwall.sdk.billing

import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.QueryProductDetailsParams
import com.android.billingclient.api.QueryPurchaseHistoryParams
import com.android.billingclient.api.QueryPurchasesParams

internal fun @receiver:BillingClient.ProductType String.buildQueryPurchaseHistoryParams(): QueryPurchaseHistoryParams? =
internal fun @receiver:BillingClient.ProductType String.buildQueryPurchaseHistoryParams(): QueryPurchasesParams? =
when (this) {
BillingClient.ProductType.INAPP,
BillingClient.ProductType.SUBS,
-> QueryPurchaseHistoryParams.newBuilder().setProductType(this).build()
-> QueryPurchasesParams.newBuilder().setProductType(this).build()
else -> null
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.superwall.sdk.billing.observer

import com.android.billingclient.api.BillingFlowParams
import com.android.billingclient.api.ProductDetails
import com.android.billingclient.api.SkuDetails

class SuperwallBillingFlowParams private constructor(
internal val params: BillingFlowParams,
Expand Down Expand Up @@ -39,12 +38,6 @@ class SuperwallBillingFlowParams private constructor(
builder.setProductDetailsParamsList(productDetailsParamsList.map { it.toOriginal() })
}

@Deprecated("Use setProductDetailsParamsList instead")
fun setSkuDetails(skuDetails: SkuDetails): Builder =
apply {
builder.setSkuDetails(skuDetails)
}

fun setSubscriptionUpdateParams(params: SubscriptionUpdateParams): Builder =
apply {
builder.setSubscriptionUpdateParams(params.toOriginal())
Expand Down
Loading