fritz
fritz

Reputation: 33

How to perform ios IAP in the same device but different account

My iOS app need to log in to our sever and buy Non-consumable product. I've done some research.

My question is that I log in our to sever in A device to buy one product with B Apple id, if i change another account to log in to the sever and still using B Apple id. I still get the product I bought from previous account.

How do I distinguish different account ?

Upvotes: 1

Views: 401

Answers (1)

Frankenxtein
Frankenxtein

Reputation: 493

when an user makes a purchase send the original_transaction_id to your server and store it in your database along with the productID and your custom account. later when a user tries to restore purchases, get the list of purchased products via StoreKit and send the product's original_transaction_id to your server. In your server check if the original_transaction_id is tied to any of your app's users previously or not. if yes, the user actually purchased the product. else, show an error like this item was purchased by another user using this appleId.

Upvotes: 2

Related Questions