How do you determine the customer/user when receiving an Apple statusUpdateNotification for auto renewing subscriptions?

纵然是瞬间 提交于 2019-12-08 07:02:45

问题


So, Apple has implemented their server to server notification for various events in the subscription lifecycle.

I was very excited to get going on this but then it seems there is some sort of glaring thing I'm missing. I'm not sure how to match the notification data to a user on my side. I'm surprised there isn't a uid/apple id passed with the notification to match on. Maybe I'm supposed to be using the original_transaction_id but its unclear whether that is unique.

Does anyone know what to use in the status response?


回答1:


I use the original_transaction_id to match the event to a user.




回答2:


Apple will send to your server a receipt_data. In receipt_data will have original_transaction_id. But If you just only have original_transaction_id received from apple, you couldn't detect who is buyer this item. So in my opinion, Your server need store an unique id between original_transaction_id and user_id. When apple send receipt_data to hook that you set up to receive apple statusUpdateNotification, you will get user_id from match with original_transaction_id to put data into your database.



来源:https://stackoverflow.com/questions/45364325/how-do-you-determine-the-customer-user-when-receiving-an-apple-statusupdatenotif

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!