How do I associate a user with an automatic renewable subscription with Apple status notification?

How do I associate a subscription with auto-renew so that I know what notifications are for users in my database? Is there some kind of identifier from the original receipt that I can save as a field for the user?

Itโ€™s great that I know when a user cancels or updates, etc., but it doesnโ€™t help that Iโ€™m not sure which user this is for.

When you visit the documents and scroll down to Update Status Notifications , you will notice that the status notifications have the original_transaction_id field, is that what is saved and what can you rely on?

+7
ios objective-c swift storekit
source share
1 answer

Yes, you can use original_transaction_id . This property is retained for all updates.

If the user cancels his subscription and buys a new subscription, then original_transaction_id will change.

However, if a user renews or downgrades their subscription, original_transaction_id will not change.

This is supported on modern versions of iOS, including iOS 10.

Another way to do this is to save an array of transaction_id values โ€‹โ€‹and associate them with user accounts. Depending on your needs, this may work best for you.

+1
source share

All Articles