0

I have an app that uses auto-renewal subscriptions. I need to access completed transactions to determine if a user has a valid subscription or not. I understand that 'restoreCompletedTransactions' will do this for you, however, it annoyingly requires the user to re-enter their iTunes password.

Is there a better way of doing this? Storing the receipt data locally would make no sense, as I would have to check the latest transaction to ensure the expires_date has not been met yet, so I would assume I need to always download the transaction data from Apple directly.

JimmyJammed
  • 9,598
  • 19
  • 79
  • 146

1 Answers1

1

you want to store the receipt data and your sharedsecret if you want to know the user is valid or not you want to post the receipt data an your shared secret to apple server and the apple will respond to the latest receipt and an status of the latest receipt it that status is "0" then the user is valid or else if status is "21006" This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response. verify this link

  • Yeah, this was the conclusion I came to. My idea is to store the receipt data in NSUserDefaults for the product identifier as the key. Then verify with apple to get the latest data in response. My question is, is it safe to store your shared secret in the app? What potential problems could this cause if someone hacked the device and accesses this shared secret password? – JimmyJammed Mar 12 '13 at 16:48
  • https://developer.apple.com/library/ios/#releasenotes/StoreKit/IAP_ReceiptValidation/ go to this link once download the companion file on the top right corner in .h file #define ITC_CONTENT_PROVIDER_SHARED_SECRET @"your secret here" here you want to enter your shared secret this was provided by apple – MANCHIKANTI KRISHNAKISHORE Mar 12 '13 at 19:11