Ios auto renewal subscription and user in our service

In our service, each user has a username (email address), password and unique identifier. How can I link any purchases made through Apple to an auto-renewal subscription for this user?

Is there any field that makes an Apple user unique? I don't want to associate it with a device because the user can run the app from many devices, so I need a unique ID for the user.

+3


source to share


1 answer


Apple does not provide you with a unique identifier for your Apple user or Apple ID (possibly to protect user privacy). What I was doing was using their first Auto-Renewing copy as their unique identifier. Therefore, you should be able to use original_transaction_id

receipts in your checks. When you check the receipt with Apple's servers, the response should include the transaction ID of the original auto-renewal subscription that the user purchased from you, no matter what device they were on. And I found that even if the subscription expires and then starts over again, there will always be one original auto-renewal transaction referenced.

It's a bit of a trick, but it seems to work.



Alternatively, you can also use the iCloud key store to store your unique ID. This ID will be the same on all user devices, but they must enable iCloud on all of their devices. And technically, they can use different accounts for iCloud than they use to shop, so that's not ideal.

+4


source







All Articles