I am looking for advice on how to associate a purchase with a particular user, (for example, a game center user) basically the user who makes the purchase. The purchase is a consumable item or subscription, so it can't be restored.
My overall design using server product delivery mode is largely working, but it doesn't work with some edge or negative cases, when a transaction is interrupted. For example,
- gamecenter_user1 makes the purchase
- payment is made but app is terminated
- log in as gamecenter_user2 from game center app
- relaunch the app
- SKPaymentTransactionObeserver receives transation update
- gamecenter_user2 gets the purchase
Before making a purchase, I know the user who makes the purchase, and product identifier, I can save this information. However after receiving transaction or receipt from App Store, how do I identify the user who made this purchase?
Thanks