Restore purchases when testing IAP locally in Xcode 12

Hello,
I've been trying out local testing of in-app purchases in Xcode 12, and it seems that I can't restore previously purchased products.

More precisely, when I purchase a product and then I tap on it to purchase it again (for free this time) then it works well and I see the new transaction in the Transactions Manager in Xcode as Restored.

However, when I use a custom Restore button to initiate a restore process using the restoreCompletedTransactions() method of the StoreKit nothing happens, and the number of transactions in the queue object of the paymentQueueRestoreCompletedTransactionsFinished(:)_ is zero.

Are there any steps that I'm missing so I can test product restore locally in Xcode?

Thanks for any help in advance!
Could you submit feedback, and include information about your configuration (i.e. Xcode & OS beta version, physical device or simulator type, etc.) and an attached sysdiagnose?
You're not alone. Bumped into this one as well. Exactly the same behavior.

Unfortunately, I don't have any solution yet.
I have faced the same issue and I haven't found solution so far.

The steps I follow in order to reproduce:
  • I buy a non-consumable.

  • I check my local transactions by navigating to Debug - StoreKit - Manage Transactions. The transaction is there.

  • I remove the application.

  • I do install the application again, I click into my button for restoring purchases - this button triggers restoreCompletedTransactions() from the StoreKit framework - but I receive zero transactions.

  • If I navigate again to Debug - StoreKit - Manage Transactions, I can see there are no transactions.

Apparently those transactions are linked to a specific build so as soon as you remove the application the transactions will be gone.

It would be great to get any feedback from Apple.

Thank you in advance.
I noticed that if I sign out of the Sandbox Account by Settings -> App Store -> SANDBOX ACCOUNT Sign Out, then the restore will be successful.

Sign out of Sandbox Account through settings.
Remove the app.
Re-install the app.
Attempt to restore IAP by signing in again to the sandbox test account when triggered.

If I do not sign out of the SANDBOX ACCOUNT, then the restore will fail.
I have the same problem in both simulators and my test device. Just submitted feedback as requested by Frameworks Engineer. Hope apple does something soon to solve this. StorekitTest is a really nice thing to have if not for this issue
Seeing the same thing on macOS 11, most recently with Xcode 12.2 rc: restoreCompletedTransactions finishes with no transactions. Other functions work fine.

Steve
I have the same problem Im trying with (in non-consumable purchase):
do {
      let receipt = try InAppReceipt.localReceipt()
      let purchased = receipt.containsPurchase(ofProductIdentifier: productId)
      completion(.success(purchased))
    } catch {
      print(error)
      completion(.failure(error))
    }
but nothing
Restore purchases when testing IAP locally in Xcode 12
 
 
Q