How to make auto renewable subscriptions tied to in-house user, not apple id?

后端 未结 1 1195
傲寒
傲寒 2021-02-05 09:22

I seem to have hit a brick wall, but essentially what I have in my app is a login page for the user and a create account page. When the user opens my app and creates a new accou

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 09:45

    When the transaction get completed on iTunes you get a transaction receipt for that purchase. This receipt contains various information about the purchase. You can store this receipt in your DB. In this receipt, there is also a field named "original_transaciton_identifier(OTI)", this identifier denotes the unique id of purchase made from that Apple id. Store this unique identifier in your DB against the user id which is sending it first.

    So now, if user id A sends you an OTI 11, store it in your DB against user A. When user B logs in and tries to restore purchase, send the updated receipt to your server, take out the OTI from this receipt, compare it with the OTIs stored in your DB, if you do not find anything then it means its a new purchase, otherwise you know to whom does this purchase belong and you can convey the same to user B that this is linked to some other user, try making a purchase with a new itunes account.

    0 讨论(0)
提交回复
热议问题