Getting different receipts back (corresponding to different test iTunes account) from App Store whilst using Sandbox to test auto-renewable subscriptions

I am trying to test my auto-renewable subscription using the sandbox. So I am getting the local receipt from mainBundle.appStoreReceiptURL?.path, and sending that to my server which then sends it on to the App Store. I then parse the response from the app store. So far so good. My subscription renewal server code works.


I have two iTunes testing accounts verified, and i have successfully purchased and renewed my auto-renewable subscription products for both accounts. The problem is, sometimes i get a receipt back from the app store that does not match that of the current logged in iTunes account but of the previous and vice versa. I know the receipt is related to the other test iTunes account becuase the 'original_transaction_id' is different, and the recipts do not contain a record of the transactions executed by the current logged in user.


Please can someone advise?

Replies

The user account associated with app is 'sticky' in sandbox testing. I do not now if this 'issue' also exists in the production environment. If you delete the app and log out of the App Store before reinstalling from Xcode the 'sticky' disappears.