user185955
user185955

Reputation: 359

iOS Subscription latest_receipt_info

I'm building a react native app that has a 1 month subscription component. I have integrated into the apple API to get the receipts but I have one question I can't seem to figure out in test mode. Probably a newbie question but here we go...

When a user has an auto-renewing subscription and I call the Apple API there is the latest_receipt_info.

  1. Will I get a new one every month? if so when does it come through?
  2. So will all I have to do is call the Apple API, grab the latest transaction from latest_receipt_info and look at the "expires_date" field. If we are still before this date then I assume the subscription is still active? Can it be this simple to see if a subscription is active or not?

I've seen talks online about a "cancellation_date_ms" field but I can't seem to find it in sandbox mode, but why would this be needed if I just use the logic I stated above?

Upvotes: 2

Views: 523

Answers (1)

You can get an updated receipt any time by calling Apple with receipt data from the application, even if you send older data Apple always sends you the latest receipt.

You can check for the expiration date within, however it is the case if a user gets a refund the expiration date may still be in the future - in that case you'd be sent the cancellation_date_ms as well, so you should look out for that.

To get a better understanding of what all can be in latest_receipt_info, read through the entries in here, search for responseBody.latest_receipt_info:

https://www.namiml.com/blog/app-store-verify-receipt-definitive-guide

Upvotes: 2

Related Questions