How can i get latest receipt from the list of latest_receipt_info?
ios, objective-c, xcode
Solution
You can use kVC for that, something like this might work
NSDictionary *dictLatestReceiptsInfo = response[@"latest_receipt_info"];
long expirationDateMs = [dictLatestReceiptsInfo valueForKeyPath:@"@max.expires_date_ms"];
Problem
I have three type of subscription with 1 months, 6 months and 1 year. on the sandbox url `https://sandbox.itunes.apple.com/verifyReceipt` i am getting a long list of receipt around 242 and its increasing with time. I want to pass latest expiry date for the all subscription. how can i say that this is latest receipt for the perticular subscription and pass expiry date for the subscripation to my web service ``` { environment = Sandbox; "latest_receipt" = "MILFMwYJKoZIhvcNAQcCoILFJDCCxSACAQExCzAJBgUrDgMCGgUAMIK05AYJKoZIhvcNAQcBoIK01QSCtNExgrTNMAoCAQgCAQEEAhYAMAoCARICAQEEAhYAMAoCARMCAQEEAgwAMAoCARQCAQEEAgwAMAsCAQECAQEEAwIBADA””; "latest_receipt_info" = ( { "expires_date" = "2014-03-12 10:18:05 Etc/GMT"; "expires_date_ms" = 1394619485000; "expires_date_pst" = "2014-03-12 03:18:05 America/Los_Angeles"; "is_trial_period" = false; "original_purchase_date" = "2014-03-12 10:15:06 Etc/GMT"; "original_purchase_date_ms" = 1394619306000; "original_purchase_date_pst" = "2014-03-12 03:15:06 America/Los_Angeles"; "original_transaction_id" = 1000000093384828; "product_id" = “myapp.1"; "purchase_date" = "2014-03-25 12:21:23 Etc/GMT"; "purchase_date_ms" = 1395750083000; "purchase_date_pst" = "2014-03-25 05:21:23 America/Los_Angeles"; quantity = 1; "transaction_id" = 1000000104232856; "web_order_line_item_id" = 1000000027948608; } { "expires_date" = "2013-11-14 10:23:43 Etc/GMT"; "expires_date_ms" = 1384424623000; "expires_date_pst" = "2013-11-14 02:23:43 America/Los_Angeles"; "original_purchase_date" = "2013-11-14 10:20:44 Etc/GMT"; "original_purchase_date_ms" = 1384424444000; "original_purchase_date_pst" = "2013-11-14 02:20:44 America/Los_Angeles"; "original_transaction_id" = 1000000093384828; "product_id" = "myapp.2"; "purchase_date" = "2014-03-29 05:37:36 Etc/GMT"; "purchase_date_ms" = 1396071456569; "purchase_date_pst" = "2014-03-28 22:37:36 America/Los_Angeles"; quantity = 1; "transaction_id" = 1000000093384828; "web_order_line_item_id" = 1000000027562376; }, ); ```