咨询:苹果In-App Purchase API返回的类JSON格式名称是什么?
Hey there! That special JSON-like format you're seeing after decoding an Apple IAP receipt is Apple's ASCII Property List (plist) format—sometimes called the OpenStep plist syntax.
A quick breakdown of how it differs from standard JSON:
- Uses
=instead of:to separate keys and values - Ends each key-value pair with a
; - Maintains curly braces for dictionaries, just like JSON, but the syntax has its own ecosystem-specific quirks
Here's your original receipt snippet for reference:
{ "purchase_info" = "123"; "subscription_id" = "7F12371239123"; }
And if you converted it to standard JSON, it would look like this:
{ "purchase_info": "123", "subscription_id": "7F12371239123" }
If you need to work with this format programmatically or convert it to something more familiar, Apple's built-in plutil command-line tool can handle conversions to JSON or XML plist formats easily. For example:
plutil -convert json input_receipt.plist -o receipt.json
This format has been a staple in Apple's ecosystem for decades, used for everything from app configuration to storing receipt data like you encountered with IAP subscriptions.
内容的提问来源于stack exchange,提问作者Engineer

