Stuck in the sandbox

I created a test account to verify application purchases. I could buy, and the purchase was successful. After that, I found a navigation error. I fixed the error, created another account and deleted the account that I registered in the previous session. Now I can no longer test in-app purchases, as the app store automatically registers me with a ghost account that no longer exists. I am only asked to enter a password, despite the fact that before each debugging session I exit the Store in Settings and uninstall the previous version of the application. How to do this reset?

Thank,

Nava

+3
source share
3 answers

I know this is an old topic, but I had problems finding a solution, and I went through some breathtaking trial versions and errors until I found out the solution, so I thought that I would share it here, since I don’t could find him otherwise.

First, make sure that after each transaction you call:

    [[SKPaymentQueue defaultQueue] finishTransaction:transaction];

In my case, it happened that the transaction was not completed and remained in the queue, so even when I switched to another isolated account, it continued to request my old account password.

To fix this, I added:

SKPaymentQueue *queue = [SKPaymentQueue defaultQueue];
for (SKPaymentTransaction *transaction in queue.transactions) {
    [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
}

BEFORE I added a transaction observer, that is:

[[SKPaymentQueue defaultQueue] addTransactionObserver:self];

Besides, in

(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

I added this line of code:

[queue finishTransaction:transaction];

SKPaymentTransactionStateRestored SKPaymentTransactionStateFailed switch. , , .

, , , iPhone, , /, , , . , -.

EDIT: (11/12/15)

, . , , , . , .

, :

[[SKPaymentQueue defaultQueue] removeTransactionObserver:self];

tearDown ( applicationDidEnterBackground:) , . , , , . , , , .

+1

, , "" β†’ "" β†’ "", ? ? .

0

. :

  • β†’ Reset β†’ Reset
  • β†’ iTunes β†’
  • XCode

UPDATE: , , :

[[SKPaymentQueue defaultQueue] finishTransaction:tran];

, , iPhone . , .

0
source

Source: https://habr.com/ru/post/1729724/


All Articles