Skip to main content
Question

Complete transaction in didFinishLaunchingWithOptions?

  • June 18, 2022
  • 1 reply
  • 114 views

Forum|alt.badge.img+4

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

1 reply

Roberto Ansuini
Forum|alt.badge.img

Hi @ThierryB 

 

Sorry for the late response. I see that you are using the SwiftyStoreKit, have you checked already the documentation for migrating to RevenueCat. https://docs.revenuecat.com/docs/swiftystorekit#app-startup

 

Once you have configured your customer after a crash you will be able to check the purchases made and if they are complete so you can finish whatever steps are remaining then.

 

Hope it helps

 

For future reference if you need quicker response times you can email us at support@revenuecat.com 

 

 

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings