Search code examples
iosin-app-purchaseapp-store

iOS restores in-app purchase although no iTunes account is logged in


One of my iOS apps has been in the App Store for years, offering different non-consumable in-app purchase items.

Currently I am working on adding some new consumable items as well. Since the simulator does not support test purchasing I am running the test on my real device:

  • The device is running iOS 12. Within the system settings I have logged our from my real iTunes account and rebooted the device.
  • In AppStoreConnect I have created a new test user / iTunes Account and activated it
  • After installing the new app version on the device using Xcode 10 I started the process to restore previous purchases using [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]

I expected that iOS would present an App Store login where I could use the credentials of the new test account. Instead paymentQueue:updatedTransactions: is called with different transactions in SKPaymentTransactionStateRestored state. I assume that these are the real transactions I made with my real App Store account some time ago.

How is this possible when being logged out from iTunes/App Store?

The result is the same, even when I login to the test account within the system settings, reboot the device run the restore process than.

Why are the transactions of my real account are restores while being logged in with another account (the test account)?

What can I do do force iOS to log out from my real account and use the test account instead?


Solution

  • enter image description here

    Check Settings->iTunes & App Stores -> Scroll Down here is SANDBOX ACCOUNT log out sandbox account too and everything will work