Search code examples
iosobjective-cin-app-purchaseobjective-c++skpaymenttransaction

The purchase dialog does not show up since iOS 13.4


Since iOS 13.4, the dialog for in-app purchases does not show up when the line...

[[SKPaymentQueue defaultQueue] addPayment:payment]; 

...is executed.

Pre iOS 13.4 a dialog popup showed up where the user confirmed the purchase, but now nothing. Does anyone know what might be causing this issue?

Notes:

  • 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

Solution

  • try to totally "flush" the queue once:

        - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { 
            for (SKPaymentTransaction *transaction in transactions) {
    
            //debug - finish all transactions to make queue empty  
            [[SKPaymentQueue defaultQueue] finishTransaction:transaction]; 
    /*
                switch (transaction.transactionState) {
                    case SKPaymentTransactionStatePurchased:
                         //your code 
                         [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                         break;
    
                    case SKPaymentTransactionStateFailed:
                        //your code 
                        [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                        break;
                }
    */
            }
        }
    

    then after replace it back by your code and try to make purchase.