7

I am working with auto-renewable subscriptions. When the app has successfully finished a transaction, it sends the receipt to our server to validate it and to check that the last transaction identifier exists in the receipt.

From time to time, our server returns an error saying that the transaction identifier is not found in the receipt. I have confirmed that locally, in the app. Even after refreshing the receipt, sometimes the transaction identifier can't be found.

Also, the purchase has succeeded because trying to buy again the same subscription prompts an iOS pop up saying that the subscription is currently active.

Obviously this strange behaviour is happening in the sandbox environment. Also note, that I am using up to 3 test users switching back and forth between them.

Has anyone experienced a similar problem?

Any ideas about what is going on?

Xavi Gil
  • 11,460
  • 4
  • 56
  • 71
  • Can you give a JSON copy of the receipt either from your server or from the app? (e.g., something like that given here http://stackoverflow.com/questions/19222845/ios7-receipts-not-validating-at-sandbox-error-21002-java-lang-illegalargume/19963192#19963192) – Chris Prince Feb 19 '14 at 18:42
  • @ChrisPrince I don't think showing the receipt would help. As I said, the transaction id is not there. Anyway, I have posted some sort of an answer that could explain what is going on. Thanks. – Xavi Gil Feb 21 '14 at 17:34

1 Answers1

0

For the last 2 days I've been testing our code with one single iTunes test user, and I haven't come across that problem anymore. Not even once.

I am almost sure the problem is caused by switching between iTunes test users in the sandbox environment. Somehow, in that scenario, the app receipt is not always consistent.

No way to prove it though :(

Xavi Gil
  • 11,460
  • 4
  • 56
  • 71