In-app purchases stopped working in iOS 13.4 The purchase dialog does not show up.

Since iOS 13.4, the dialog for in-app purchases does not show up when the line "[[SKPaymentQueue defaultQueue] addPayment:payment];" is executed.

Pre 13.4 a dialog popup showed up where the user confirmed the purchase, but now nothing.


If anyone knows more about this issue, or have the same problem, please respond


Notes on my app/game:

- It's a fullscreen game based upon libSDL and gles 3.0.

- While 99% of the code base is C++, the in app purchases is made in Objective C++

- It worked before iOS 13.4

Replies

This doesn't quite answer your question, as asked, but consider this...

What is new is you generate an error message and don't display anything in the UI if you do not get back to the main queue here:


-(void) productsRequest: (SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)re
        
    dispatch_async(dispatch_get_main_queue(), ^{


//     code here that might include presenting a UIAlertController


    });
}

I don't really understand what you mean? I don't create any UIController myself, and I don't see any error msg anywhere.

Is this in the sandbox running on a device connected to Xcode or is it using TestFlight or is it using a production app?


Are you getting a call back to updatedTransactions showing a state of 'purchasing'?

This is happening in production (Grand Mountain Adventure is the name of the app).

You might be onto something, it seems the state of the transaction is Failed, SKErrorDomain Code=2 (Cannot connect to iTunes Store), which prevents the dialog from opening.


Info about the issue:

The last couple of days we've gotten compliants from users that they cannot purchase the in-app purchase, all of them have iOS 13.4.

When I upgraded my device to iOS 13.4 the same thing happened to me.

>the state of the transaction is Failed, SKErrorDomain Code=2 (Cannot connect to iTunes Store), which prevents the dialog from opening.


StoreKit will issue a 'failed' transaction to updatedTransactions if the user needs to refresh their credit card information. If the user refreshes their credit card information and then choses to proceed with the purchase then StoreKit issues two transactions in rapid succession - a failed and then a purchased. An app needs to hande that first 'failed' transaction silenetly and await the possibility of that second transaction. If your app drops its transaction observer after the 'failed' then the next transaction will await adding a transaction observer which might take place if the user tries to restoreCompletedTransactions.


But again, the only 'new' thing I am aware of is that need to get back on the main queue after a product request.

I assume you meant "In App Purchase" not "app". Otherwise this is an App Store problem.


> The last couple of days we've gotten compliants from users that they cannot purchase the app, all of them have iOS 13.4.

Thanks for taking the time.

You are correct, I mean the in-app purchase (updated).

Just for clarification, I haven't uploaded ny new app version, in-app purchases just seems to have stopped working for users of iOS 13.4, it seems Flutter actually has the same issue: https://github.com/flutter/flutter/issues/53534

Regarding the queue, I never kill or stop the transaction observer, nor do I block on the main thread. The method updatedTransactions get's executed everytime the user tries to buy (as the dialog is not shown, users usually press several times).

Or do you mean I have to manually restart the transaction observer?


Best/Viktor

First, ensure you're finishing transactions upon success/failure:


In our case, the old code was not calling `SKPaymentQueue.default().finishTransaction(transaction)` to remove it from the queue. Prior to iOS 13.4, that apparently worked fine even though the documentation says it’s required


So what would happen is the dialog would show once and the person would cancel and then from that point on the transaction would persist in the queue and automatically return as cancelled without showing the dialog again. Finishing the transaction purges it and allows the dialog to show again


---


If that doesn't work:


Per an Apple engineer's request, I filed a radar for this (FB7648374) with App Store logging and sysdiagnose


Please do the same:


- Follow the instructions for App Store logging at https://developer.apple.com/bug-reporting/profiles-and-logs/

- Install the profile on your device that enables verbose logging

- Then repro the problem on your device w/ device logs running (Xcode -> Devices -> Console logs)

- Then immediately capture a sysdiagnose

- File a new radar with that information at https://feedbackassistant.apple.com/

In my case:

On the iOS 13.4 version of the device for multiple downgrades of in-applied products or canceling the purchased product before buying again, the confirmation payment dialog box will not pop up.

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactions

The transaction status returned by the method is directly SKPaymentTransactionStatePurchased. However, this order was not included in the order collection returned when verifying the receipt with the App Store.

However, the results of the above operations on the iPhone before iOS 13.4 version are all normal.

BTW, have you solved this problem?

That thing about credit card is not true at 100% since also with sandbox users has the same behavior.


Looks like an Apple problem.

But doesn't that test whether you handle a failed transaction correctly! Maybe it is a feature not a bug.

I'm facing the same issue. Any updates on this?

Did you find right solution ?