Do I have to call SKReceiptRefreshRequest to get Cancellation_date field ?

Hi, I kind of lost in the documentation of Cancellation Date Topic.


https://developer.apple.com/library/archive/technotes/tn2413/_index.html#//apple_ref/doc/uid/DTS40016228-CH1-RECEIPTURL

so the documentation states
The appStoreReceipt is refreshed only in the following cases after the refund has occurred - when there is a successful purchase of an in-app purchase item, when the

SKReceiptRefreshRequest
call is used and when the
restoreCompletedTransactions
is used to restore previously purchased products.

if my server is responsible for verifying the receipt,
would it get an updated receipt with a field of cancelldation_date after apple has issued an refund
or do I have to call SKReceiptRefreshRequest and notify the server if I found the field in the updated receipt ?
If I have to call SKReceiptRefreshRequest to get the updated receipt,
when is the best time to do it?
thanks

Accepted Reply

For an autorenewable subscription you can send any receipt to the Apple servers and they will respond with a latest_receipt and latest_receipt_info field. Those fields will contain a cancellation_date field if the purchase was cancelled. Note that a cancelled purchase is different from cancelling the next autorenewal of the subscription.


For a non-consumable IAP or a non-renewing subscription you do not get that latest_receipt or latest_receipt_info field back from the Apple servers. To get a new receipt you have to referesh the receipt using one of those functions.



> If I have to call SKReceiptRefreshRequest to get the updated receipt,

when is the best time to do it?


Because it will require a log-in to the App Store you need to tell the user you are doing it. The best time is when the user tries to use something that requires the subscription/non-consumable. Post an alert saying that the app needs to check their subscription and give them the option of saying "not at this time". Remember that cancellations are rare and your users fall into 4 categories - paid, cancelled and no longer using, cancelled and still using but won't pay again if caught, cancelled and still using but would pay again if caught. So ask yourself whether the pain to all your loyal users is worth the value you would derive from preventing a small amount of thieft.


And ---- if you want to detect the more frequent user who "cancels" the autorenewal (not cancels the subscription) then you are not looking for a cancellation_date field and what you can do is wait for the current subscription to expire, issue that alert and do a restoreCompletedTransaction. In the future, after a restore, the App Store will send a renewal notice to updatedTransactions each renewal period if you do an addTransactionObserver.

Replies

For an autorenewable subscription you can send any receipt to the Apple servers and they will respond with a latest_receipt and latest_receipt_info field. Those fields will contain a cancellation_date field if the purchase was cancelled. Note that a cancelled purchase is different from cancelling the next autorenewal of the subscription.


For a non-consumable IAP or a non-renewing subscription you do not get that latest_receipt or latest_receipt_info field back from the Apple servers. To get a new receipt you have to referesh the receipt using one of those functions.



> If I have to call SKReceiptRefreshRequest to get the updated receipt,

when is the best time to do it?


Because it will require a log-in to the App Store you need to tell the user you are doing it. The best time is when the user tries to use something that requires the subscription/non-consumable. Post an alert saying that the app needs to check their subscription and give them the option of saying "not at this time". Remember that cancellations are rare and your users fall into 4 categories - paid, cancelled and no longer using, cancelled and still using but won't pay again if caught, cancelled and still using but would pay again if caught. So ask yourself whether the pain to all your loyal users is worth the value you would derive from preventing a small amount of thieft.


And ---- if you want to detect the more frequent user who "cancels" the autorenewal (not cancels the subscription) then you are not looking for a cancellation_date field and what you can do is wait for the current subscription to expire, issue that alert and do a restoreCompletedTransaction. In the future, after a restore, the App Store will send a renewal notice to updatedTransactions each renewal period if you do an addTransactionObserver.

Yeah, I was confused when I realized that cancellation_date is the field for cancellation from apple suppot team,
I thought it would be the user cancelling the auto-renewal 😟.

thank you, that's pretty much all I need to know for now 🙂