Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BC7 #1737

Merged
merged 4 commits into from
Jun 6, 2024
Merged

Support BC7 #1737

merged 4 commits into from
Jun 6, 2024

Conversation

tonidero
Copy link
Contributor

@tonidero tonidero commented Jun 6, 2024

Description

This PR adds support for BC7 and related new features.

New APIs:

  • SubscriptionOption.installmentInfo which contains information about installment plans you might want to display in your paywall.
  • PurchasesConfiguration.pendingTransactionsForPrepaidPlansEnabled allows to enable pending prepaid subscriptions.

Breaking changes

  • Increase min Sdk to 21. This was increased in BC7
  • Remove UpgradeInfo
  • Remove all purchasePackage and purchaseProduct methods using UpgradeInfo. If you want to perform upgrades/downgrades, please migrate to use the purchase(PurchaseParams) method, which has options to perform that operation.

JayShortway and others added 4 commits June 6, 2024 16:29
Adds the minimum required changes to be able to compile with BC7.

- Bumps the version to `8.0.0-SNAPSHOT`.
- Bumps the `minSdkVersion` to 21 (Android 5.0).
- `UpgradeInfo` now takes a `ReplacementMode` instead of the now-removed
`ProrationMode`.
- Removed the deprecated `GoogleProrationMode`, as it was using the
now-removed `ProrationMode`.
- Removes deprecated `StoreTransaction` constructor taking a
`GoogleProrationMode`.
- Removes `PurchaseParams.Builder.googleProrationMode()`.

- Uses Billing Library `7.0.0`.
- Added `GoogleReplacementModeAPI.java`
### Description
This exposes the info for installment plans so developers can use it.
The new API looks like:
- New `InstallmentsInfo` interface with `commitmentPaymentsCount` and
`subsequentCommitmentPaymentsCount` fields.
- New `GoogleInstallmentsInfo` data class implementing previous
interface.
- New method in `SubscriptionOption`/`GoogleSubscriptionOption` exposing
the installments info.
PR to support pending prepaid purchase as a new feature added in BC7.
This will be enabled by default but can be disabled through an option in
`PurchasesConfiguration`: `pendingTransactionsForPrepaidPlansEnabled `.
@tonidero tonidero added the pr:breaking Changes that are breaking label Jun 6, 2024
@RevenueCat-Danger-Bot
Copy link

1 Message
📖 Size increase: 13.74 KB

Generated by 🚫 Danger

Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 83.78378% with 6 lines in your changes missing coverage. Please review.

Please upload report for BASE (8.0.0-dev@4a7582b). Learn more about missing BASE report.

Files Patch % Lines
.../kotlin/com/revenuecat/purchases/common/Backend.kt 50.00% 3 Missing and 2 partials ⚠️
...om/revenuecat/purchases/models/TestStoreProduct.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             8.0.0-dev    #1737   +/-   ##
============================================
  Coverage             ?   82.99%           
============================================
  Files                ?      222           
  Lines                ?     7576           
  Branches             ?     1070           
============================================
  Hits                 ?     6288           
  Misses               ?      872           
  Partials             ?      416           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tonidero tonidero marked this pull request as ready for review June 6, 2024 15:10
@tonidero tonidero requested review from a team and removed request for a team June 6, 2024 15:10
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@tonidero tonidero merged commit df1fb39 into 8.0.0-dev Jun 6, 2024
9 checks passed
@tonidero tonidero deleted the sdk-3465-support-bc7 branch June 6, 2024 17:02
@@ -51,7 +51,7 @@ Or view / build our Android sample app:
## Requirements
- Java 8+
- Kotlin 1.5.0+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh do we need to update this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh good catch! Will update that since I'm writing the migration docs.

@@ -277,6 +277,7 @@ class Purchases internal constructor(
val configuration = PurchasesConfiguration.Builder(context, apiKey)
.appUserID(appUserID)
.dangerousSettings(DangerousSettings(customEntitlementComputation = true))
.pendingTransactionsForPrepaidPlansEnabled(true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this always true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we want to enable it by default for companies using customEntitlementComputation. We can provide an option to disable it later if needed though, but we try to keep the API very small in the customEntitlementComputation flavor I think.

tonidero added a commit that referenced this pull request Jun 11, 2024
For a full migration guide check
[v8-MIGRATION.md](migrations/v8-MIGRATION.md)

### Breaking Changes
* Support BC7 (#1737) via Toni Rico (@tonidero)

#### New APIs:
- `SubscriptionOption.installmentInfo` which contains information about
installment plans you might want to display in your paywall.
- `PurchasesConfiguration.pendingTransactionsForPrepaidPlansEnabled`
allows to enable pending prepaid subscriptions.

#### Breaking changes
- Increase min Sdk to 21. This was increased in BC7
- Increase min kotlin version to 1.7.0
- Remove `UpgradeInfo`
- Remove all `purchasePackage` and `purchaseProduct` methods using
`UpgradeInfo`. If you want to perform upgrades/downgrades, please
migrate to use the `purchase(PurchaseParams)` method, which has options
to perform that operation.

### Other Changes
* Bump kotlin to 1.8 (#1726)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:breaking Changes that are breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants