Skip to content

Send initiation_source in post receipt requests#1212

Merged
tonidero merged 2 commits into
mainfrom
toniricodiez/sdk-2858-android-code-to-send-headers-to-match-ios-with-queue-restore
Aug 30, 2023
Merged

Send initiation_source in post receipt requests#1212
tonidero merged 2 commits into
mainfrom
toniricodiez/sdk-2858-android-code-to-send-headers-to-match-ios-with-queue-restore

Conversation

@tonidero

@tonidero tonidero commented Aug 30, 2023

Copy link
Copy Markdown
Contributor

Description

This PR adds a new initiation_source field to the post receipt body that indicates where the receipt was originated from. This is already done in iOS.

@tonidero tonidero marked this pull request as ready for review August 30, 2023 09:12
@tonidero tonidero requested a review from a team August 30, 2023 09:12
@tonidero tonidero changed the title Send initiation_source in post receipt requests Send initiation_source in post receipt requests Aug 30, 2023
@codecov

codecov Bot commented Aug 30, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.93%. Comparing base (baad435) to head (c3b3634).
Report is 520 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1212      +/-   ##
==========================================
+ Coverage   85.89%   85.93%   +0.04%     
==========================================
  Files         183      184       +1     
  Lines        6251     6269      +18     
  Branches      910      911       +1     
==========================================
+ Hits         5369     5387      +18     
  Misses        536      536              
  Partials      346      346              

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

this.allowSharingPlayStoreAccount,
appUserID,
marketplace = null,
PostReceiptInitiationSource.RESTORE,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming RESTORE for syncing amazon here... which might depends on the user's implementation. Alternatively, we could add another source for this, but seemed unnecessary since it's still kinda a sync, even if it happens right after a purchase. Lmk if you think otherwise @aboedo

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah, this is a tricky one.

For observer mode for any other store we'd do queue, right? Maybe we should do the same here? It'd mean we don't alias unless you specifically call logIn I suppose, which should be a good thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, for observer mode in android we would actually do purchase, since it's coming from the listener.

In Android, we only use queue when syncing unsynced purchases on app open/foreground. That doesn't actually use the listener.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So for purchases outside the app, it would also be purchase

@tonidero tonidero merged commit 5a6b78e into main Aug 30, 2023
@tonidero tonidero deleted the toniricodiez/sdk-2858-android-code-to-send-headers-to-match-ios-with-queue-restore branch August 30, 2023 11:12

@NachoSoto NachoSoto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

This was referenced Aug 30, 2023
tonidero pushed a commit that referenced this pull request Aug 31, 2023
**This is an automatic release.**

### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `b2108fb` to `a297205`
(#1210) via dependabot[bot] (@dependabot[bot])
### Other Changes
* Rename `queue` initiation source to `unsynced_active_purchases`
(#1214) via Toni Rico (@tonidero)
* Send `initiation_source` in post receipt requests (#1212) via Toni
Rico (@tonidero)
* CustomEntitlementComputation: Add `restorePurchases` (#1211) via Toni
Rico (@tonidero)
* Unify caching offerings and updating update timestamp (#1206) via Toni
Rico (@tonidero)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants