I have an app that has (only) auto-renewable subscriptions:
I have a backend where I validate the receipt. I use the latest_receipt_info
value from the validation result JSON structure returned by apple to enable user's subscription. Sometimes this JSON key exists but sometimes it is missing. Here's an example response where this key is missing:
{
"status":0,
"environment":"Sandbox",
"receipt":{
"download_id":0,
"adam_id":0,
"request_date":"2018-03-22 10:28:02 Etc/GMT",
"app_item_id":0,
"original_purchase_date_pst":"2013-08-01 00:00:00 America/Los_Angeles",
"version_external_identifier":0,
"receipt_creation_date":"2018-03-12 12:29:54 Etc/GMT",
"in_app":[
],
"original_purchase_date_ms":"1375340400000",
"original_application_version":"1.0",
"original_purchase_date":"2013-08-01 07:00:00 Etc/GMT",
"request_date_ms":"1521714482146",
"bundle_id":"my.App",
"receipt_creation_date_pst":"2018-03-12 05:29:54 America/Los_Angeles",
"application_version":"201824020001",
"request_date_pst":"2018-03-22 03:28:02 America/Los_Angeles",
"receipt_creation_date_ms":"1520857794000",
"receipt_type":"ProductionSandbox"
}
}
How should I handle this case? I need i.e. transaction_id
, product_id
fields in order to process the validated receipt.