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 non consumable products #1697

Conversation

tonidero
Copy link
Contributor

@tonidero tonidero commented May 8, 2024

Description

This brings support to non-consumables in android. The backend will let us know whether we need to consume a product after posting it or not.

@tonidero tonidero added the pr:feat A new feature label May 8, 2024
@RevenueCat-Danger-Bot
Copy link

RevenueCat-Danger-Bot commented May 8, 2024

1 Message
📖 Size increase: 11.88 KB

Generated by 🚫 Danger

@tonidero tonidero force-pushed the rev-83-update-android-sdk-to-not-consume-in-app-purchase-when-the branch from 9d9c9bb to c5faffb Compare May 8, 2024 14:38
Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 83.12%. Comparing base (61dcfdd) to head (965ff7e).
Report is 2 commits behind head on main.

Current head 965ff7e differs from pull request most recent head d693d6a

Please upload reports for the commit d693d6a to get more accurate results.

Files Patch % Lines
...tlin/com/revenuecat/purchases/PostReceiptHelper.kt 69.23% 0 Missing and 4 partials ⚠️
...purchases/common/networking/PostReceiptResponse.kt 69.23% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1697      +/-   ##
==========================================
- Coverage   83.17%   83.12%   -0.06%     
==========================================
  Files         221      222       +1     
  Lines        7555     7574      +19     
  Branches     1064     1070       +6     
==========================================
+ Hits         6284     6296      +12     
- Misses        851      854       +3     
- Partials      420      424       +4     

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

@tonidero tonidero added the HOLD label May 9, 2024
@tonidero tonidero marked this pull request as ready for review May 9, 2024 09:06
@tonidero tonidero requested a review from a team May 9, 2024 09:06
@tonidero tonidero removed the HOLD label May 15, 2024
@tonidero
Copy link
Contributor Author

Backend has been merged. Would appreciate another review for this!

@tonidero tonidero requested review from aboedo and a team May 15, 2024 14:18
}

@Test
fun `postTransactionAndConsumeIfNeeded tries to consume products if product data not available`() {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines 10 to 11
const val NOT_CONSUMING_IN_APP_PURCHASE_ACCORDING_TO_BACKEND = "Not consuming in-app purchase according to" +
" server configuration."
Copy link
Member

Choose a reason for hiding this comment

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

let's expand on the implications or maybe add a link to docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't have docs yet, but once we add it I will update this with that. Will update it briefly mentioning the consecuences though.

@tonidero tonidero enabled auto-merge (squash) May 17, 2024 14:52
@tonidero tonidero disabled auto-merge May 17, 2024 15:08
…chaseStrings.kt

Co-authored-by: JayShortway <29483617+JayShortway@users.noreply.github.com>
@tonidero tonidero enabled auto-merge (squash) May 17, 2024 15:10
@tonidero tonidero merged commit 7a4dbdc into main May 17, 2024
7 checks passed
@tonidero tonidero deleted the rev-83-update-android-sdk-to-not-consume-in-app-purchase-when-the branch May 17, 2024 15:32
tonidero added a commit that referenced this pull request May 20, 2024
### Description
As part of the efforts to support non-consumables in android, we talked
about not consuming IAPs when the backend returns a 4xx error. This
should be an uncommon case but we don't want to miss the data in that
case.

This depends on the changes to support non-consumables in #1697
tonidero added a commit that referenced this pull request May 22, 2024
### Description
Integration tests are failing on main due to the changes in #1697. This
fixes those
vegaro added a commit that referenced this pull request May 29, 2024
After #1697 , we stopped consuming non-consumables if the backend
indicates to not consume them. Non-consumables still need to be
acknowledged, otherwise they get refunded, this PR fixes that.

For reference,
https://developer.android.com/google/play/billing/integrate#non-consumable-products
This was referenced May 29, 2024
vegaro pushed a commit that referenced this pull request May 30, 2024
**This is an automatic release.**

### New Features
* Support non consumable products (#1697) via Toni Rico (@tonidero)
### Bugfixes
* Fix non-consumables not getting acknowledged (#1709) via Cesar de la
Vega (@vegaro)
* Fix bad copy in log message (#1702) via Andy Boedo (@aboedo)
### Dependency Updates
* Bump amazon SDK version to 3.0.5 (#1713) via Mark Villacampa
(@MarkVillacampa)
* Bump rexml from 3.2.6 to 3.2.8 (#1701) via dependabot[bot]
(@dependabot[bot])
* Bump fastlane-plugin-revenuecat_internal from `dd5e21f` to `8ec0072`
(#1696) via dependabot[bot] (@dependabot[bot])
### Other Changes
* Fix offline integration tests (#1704) via Toni Rico (@tonidero)
* Do not consume IAPs when backend returns 4xx errors (#1699) via Toni
Rico (@tonidero)
* Update fastlane plugin and fix docs index path (#1695) via Toni Rico
(@tonidero)
* Add trigger_bump lane (#1692) via Cesar de la Vega (@vegaro)

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:feat A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants