0

I am working on auto-renewable subscriptions in my app.

When I purchase a subscription I get the receipt from Apple and send it to my server. My server then sends it to the Apple receipt validation endpoint, and my server retrieves the required information, such as expires_date, product_id, latest_receipt_Base64, original_transaction_id, and stores it in my database for later use. In addition my app will get a response from my server saying whether the user is subscribed or not.

If I test it locally with Xcode on my device, that works fine, but when I test it with TestFlight, I get a very old receipt from Apple, which still contains a product ID that no longer exists. I deleted this product ID a few months ago.

Why don't I get the current receipt which I normally get when purchasing an IAP?

jscs
  • 63,694
  • 13
  • 151
  • 195
mufumade
  • 400
  • 4
  • 16
  • Receipts will contain the entire purchase history, even if you deleted the product ID. Testflight runs in a production environment so you'll have a different receipt history then when testing in XCode. – enc_life Mar 18 '19 at 17:25
  • Well, I send the receipt to Apple with the field `"exclude-old-transaction": true` so I look at the receipt field `"latest_receipt_info"` and there is the old product ID, which I mentioned in the question above. – mufumade Mar 18 '19 at 17:52
  • Was the last purchase for this user the old product ID or a new product ID? Are they in the same subscription group? Maybe the old product ID is still "active" for them? – enc_life Mar 18 '19 at 18:10
  • Yes the last purchase for this user is the old product ID. No these two products were not in the same subscription group. – mufumade Mar 18 '19 at 18:44
  • 1
    This sounds like expected behavior then - `the latest_receipt_info` contains their last purchase. Even if you remove a product for sale you'd need to honor it for previous users that had purchased it. – enc_life Mar 18 '19 at 19:28
  • Yeah but when I purchase a subscription the product ID should update to the new one – mufumade Mar 18 '19 at 19:29

0 Answers0