Back to All

Associating account with in-app purchase

Hi, it seems that Apple does not provide any user info in their App Store Server Notifications, therefore there are only 2 ways I can see to associate an App Store Server Notification with a user in my database.

1- Once a the call to median.iap.purchase() completes and the web app receives the transactionId, the webapp should call my backend server with userId and transactionId, store it in my DB and then, upon receiving a Notification, match the transactionId in the notification to a userId.

2- Apparently it's possible to assign my userIdto a token in the purchase, as some kind of meta-data, that is then included in the transaction body when receiving notifications. Please read this discussion for further information: https://forums.developer.apple.com/forums/thread/661308

Option 2 is a much better choice as it is less error prone, and can be leveraged in case of data losses or network failures. Option 1 is more brittle.

Is it possible to achieve option 2 via Median in-app purchases plugin?

Thank you