Corrado
Corrado

Reputation: 515

Can't remove iOS InApp Purchase sandbox account

I created 2 accounts to test inapp purchases then deleted one on iTunesConnect. When I test the InApp Purchases it continues to ask me for the password of the deleted account. I've tried to delete the app but this didn't solve the problem. I've also verified that the deleted account was not the current account in "iTunes and App Store settings". It seems this account is cached somewhere ... but where??!!

Any help?

Thanks, Corrado

Upvotes: 8

Views: 6846

Answers (3)

Victorianec
Victorianec

Reputation: 597

I understand that it's an old question but maybe someone still have such issue. Try to go Settings -> iTunes & App Store scroll down to bottom and find SANDBOX ACCOUNT and clear data here.

Upvotes: 19

Scott Kilbourn
Scott Kilbourn

Reputation: 1586

I ran across the same problem. It started happening after I began to test my restore code for an in-app purchase. I tried everything, including resetting my iPod, and it didn't matter. The login was happening when adding the transaction observer. I resolved the issue by added the following code before adding the transaction observer.

    for transaction:SKPaymentTransaction in SKPaymentQueue.defaultQueue().transactions {
        SKPaymentQueue.defaultQueue().finishTransaction(transaction)
    }

This was only temporary code, used to clear out the queue, though I don't see a problem with leaving it in. One thing I've been puzzling through is how to handle it when the app crashes while doing an IAP. It seems to leave the IAP in the queue. Instead of finishing a transaction that's the result of a crash, I would rather remove it. I haven't figured out how to do that, yet.

I then added a finishTransaction to the restore, so that I wouldn't have this issue any longer.

Upvotes: 3

Hamza Hasan
Hamza Hasan

Reputation: 1359

Go to settings -> iTunes & App Store. Tap on existing logged in Apple Id. Sign out. Then retry from app

Upvotes: 2

Related Questions