Repository navigation
docs: syncPurchases は別の身元から購入を引き取らないと書き直す - #10
Merged
Merged
Conversation
3.6.0 では、サインインの後に前の身元の購入を移す API として書いていた。 RevenueCat は今の身元が匿名のときだけ同期を復元として送るので、syncUser の後は 別の app user ID に付いた購入は動かない(PurchasesOrchestrator の allowSharingAppStoreAccount)。 移すには、uid が変わった明示のサインインの後、権利が無いときだけ restorePurchases を呼ぶ。挙動は変えない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
何のため
3.6.0 で足した
syncPurchases()を「サインインの後、前の身元の購入を新しい身元へ移す」と書いていたが、誤りだった。purchases-ios のPurchasesOrchestrator(36〜38行・386〜396行)では、syncPurchasesが送るisRestoreはallowSharingAppStoreAccount(既定は「今の身元が匿名か」)で、logInの後は false。別の app user ID(Firebase の匿名 uid も RevenueCat から見れば名前付き)に付いた購入は引き取らない。restorePurchasesは常にisRestore: true。参考: https://community.revenuecat.com/sdks-51/restorepurchases-links-multiple-users-correctly-syncpurchases-does-not-4957 ・ https://www.revenuecat.com/docs/customers/identifying-customers
変えたこと
syncPurchases()・syncUser(userId:)のドキュメントと CHANGELOG を直した。移すには「uid が変わった明示のサインインの後、権利が無いときだけrestorePurchases()」、起動ごとには呼ばないsyncUserが同期も復元もしないことを確かめる形にした🤖 Generated with Claude Code