robotmedia / RMStore

A lightweight iOS library for In-App Purchases
Apache License 2.0
2.43k stars 450 forks source link

Recommended UX for Refreshing Receipt (auto-renewables)? #203

Open xiaosongshu opened 7 years ago

xiaosongshu commented 7 years ago

First off RMStore is amazing! Been reading the wiki, almost every issue, Apple docs and Stack Overflow posts, but can't for the life of my figure this out. Any help would be appreciated!

  1. Is refreshing the receipt necessary to receive the updated inAppPurchases when an auto-renewable renew? This SO post mentions RMStore and says the app receipt updates locally on the client-side when a renewal happens even without having to refresh the receipt. However, my testing results have been inconsistent...if I don't refresh the receipt and just instantiate a receipt RMAppReceipt* appReceipt = [RMAppReceipt bundleReceipt], I'm getting a different number of inAppPurchases (ie. 14 elements when I don't refresh the receipt and 7 when I do refresh it).

  2. Sometimes, this discrepancy in the number of inAppPurchases happens after simply just restarting the app (one moment I'll have the correct number of inAppPurchases then after an app restart I get the stale 14 elements again...) Would there be any reason the receipt would display a vastly different number of inAppPurchases (stale amount) after making a single auto-renewable purchase, then immediately restarting the app (before the renewable life cycle even refreshes)? I create a brand new sandbox account with 0 purchases which then increments to 1, and on app restart, it jumps to 14 again...

  3. When restoring auto-renewables, it is recommended to restore transactions (restoreTransactionsOnSuccess). But technically, wouldn't refreshing the receipt (refreshReceiptOnSuccess) produce the same result assuming only dealing with auto-renewables?