Question

Complete transaction in didFinishLaunchingWithOptions?


Badge

Imagine that my app crashes just after a successful payment. I want to know purchase to finish when my app restarts.

I don’t see in the docs how to do it using RevenueCat.

 

I was using this code:

 

SwiftyStoreKit.completeTransactions(atomically: true) { purchases in	    for purchase in purchases {	        switch purchase.transaction.transactionState {	        case .purchased, .restored:	            if purchase.needsFinishTransaction {	                // Deliver content from server, then:	                SwiftyStoreKit.finishTransaction(purchase.transaction)	            }	            // Unlock content	        case .failed, .purchasing, .deferred:	            break // do nothing	        }	    }}

 

Thanks


0 replies

Be the first to reply!

Reply