Restoring in-app purchase no longer works

I have apps that have worked for years with non-consumable in-app purchases that users could restore. Now it no longer works.


I call

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];


In the store observer, it used to go here

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { 
     // never gets here
     for (SKPaymentTransaction *transaction in transactions) { 
        switch (transaction.transactionState) { 
            case SKPaymentTransactionStateRestored: 
                // used to go here, no longer does


Now it goes here

- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { 
    // goes here with [queue.transactions count] == 0


I've downloaded the example code here and it has the same problem.

https://developer.apple.com/documentation/storekit/in-app_purchase/offering_completing_and_restoring_in-app_purchase

Replies

The issue which you've reported is a bug report issue. I would install the StoreKit profile, capture the device console log, then replicate the problem. I would then submit a bug report. Here's the complete instructions.


Here are the instructions to install the StoreKit profile

Install StoreKit profile to an iOS 11+ device

Please login to the Apple Developer Bug Report - Profiles and Logs website

<https://developer.apple.com/bug-reporting/profiles-and-logs/> using Safari on the device you will use to replicate the problem with.

Click the “Profile” URL associated with the “App Store/iTunes Store for iOS” item. You will download the “itmsdebugging.mobileconfig” file.

For iOS 12.2 or later, you will open the Settings app -> General -> Profiles & Device Management -> iTunes and App Stores Diagnostic logging -> press Install

For devices with less than iOS 12.2, - PLEASE RESTART THE DEVICE


CAPTURE THE DEVICE CONSOLE LOG - connect the device to a macOS X Sierra system (macOS X 10.12.x or newer)

1. Launch the Console app on the macOS system, and select the device in the left side of the Console window

2. Before starting the iOS app, click “Clear”.

3. Start the application and perform the steps to replicate the problem.

4. When the issue occurs, save the contents of the Console log

Check the contents of the console log for the string “fetchSoftwareAddOns”. If this string is not present in the log, the profile was not active. Please re-install the StoreKit profile and make sure to restart the device.


If the string is found, save the entire contents of the console log to a text file.


To submit a bug report, please use the Apple Developer Feedback web page -

<https://feedbackassistant.apple.com/>.


Enter the “Feedback Assistant” page and login

Click on the Compose icon to start a new bug report


Start by clicking on the appropriate OS button - “iOS and iPadOS”, “tvOS”, or “macOS”

1. In the “Descriptive Title” field, enter an appropriate title

2. In the “Problem Area” field select “StoreKit”

3. In the “Type of Feedback” select “Incorrect / Unexpected Behavior”

4. In the “Describe the Issue” section enter the following

- application ID (and In-App Purchase identifiers if appropriate)

- sandbox or production environment

- the instructions for finding the “Buy” button to purchase the In-App Purchase item and the "Restore" button.

(if the app is not in English, please provide screenshots)


5. If you have captured a console log - drop it onto the “Drop Files to upload”.


In your case, I would capture 2 console logs - the first showing the purchase of the in-app purchase item. The second would show the restore attempt. I would include both console logs - appropriately named.


Post the Feedback number - FBxxxxxxxxxx and I'll peruse the issue when I have a chance - it might not be until after Thanksgiving break.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

Thanks for your detailed instructions. Will do this.

Were you ever able to solve this? I'm running into the same issue. Restoring works fine pre-Catalina, but fails on 10.15.3 and 10.15.4.


Thanks!

Hi!


I've got the same issue. Still no solution.

Had similar issue on simulators. switch to real device, and it's working as expected.

  • on simulator: only reach paymentQueueRestoreCompletedTransactionsFinished
  • on real device: reach updatedTransactions then paymentQueueRestoreCompletedTransactionsFinished