iOS in-app purchase's receipt string explained

2019-07-17 02:55发布

I try to understand the receipt information obtained from iTunes server, but could not find relevant documentation.

Particularly, what's the difference among unique_identifier, unique_vendor_identifier, original_transaction_id (which is claimed, in a WWDC'12 session, to be a de facto customer id) and [[[UIDevice currentDevice] identifierForVendor] UUIDString]?

{"receipt":
    {"original_purchase_date_pst":"...",        
     "purchase_date_ms":"...", 
     "unique_identifier":"...", 
     "original_transaction_id":"...", 
     "bvrs":"...", 
     "transaction_id":"...", 
     "quantity":"...", 
     "unique_vendor_identifier":"...", 
     "item_id":"...", 
     "product_id":"...", 
     "purchase_date":"...", 
     "original_purchase_date":"...", 
     "purchase_date_pst":"...", 
     "bid":"...", 
     "original_purchase_date_ms":"..."},  
"status":0}`

I wish to store this receipt information on my server to track subscription validity. So it is better to know which id I should use as a surrogate for user identity.

2条回答
狗以群分
2楼-- · 2019-07-17 03:37

Your software should only rely on the fields that Apple describes in their documentation. They could remove unique_identifier or unique_vendor_identifier, change their meaning, or change their values at any time without telling you about it.

You should follow Apple's documentation in regard to verifying subscription receipts using Apple's servers before your server transmits the sbuscription content to the device.

查看更多
\"骚年 ilove
3楼-- · 2019-07-17 03:47

In Verifying Store Receipts there is a nice table that gives the fields that seemingly one can rely on in a receipt. That specific method does rely on connecting with Apple's server. Another description (though less readable) of the receipt fields is in Receipt Fields.

查看更多
登录 后发表回答