qonversion-ios-sdk icon indicating copy to clipboard operation
qonversion-ios-sdk copied to clipboard

Support for async/await APIs

Open rudrankriyam opened this issue 4 years ago • 6 comments

Are there any plans to support the async/await APIs in the near future?

Thanks!

rudrankriyam avatar Nov 25 '21 20:11 rudrankriyam

Hi @rudrankriyam Support of Swift async/await API is definitely in our plan, but I can’t provide you with an estimation time at this moment. Considering that it is available just with iOS15 and there are not many teams with min deployment target = iOS 15, we decided to focus on more valuable features. There is a chance that Apple will add Swift async/await API to iOS13 (you can find more information about it here). If it happens, we will add async/await API support to our top-priority list. I’ll let you know!

suriksarkisyan avatar Nov 26 '21 11:11 suriksarkisyan

@suriksarkisyan Just want to update you that they have added support for iOS 13+. It is available with Xcode beta 13.2, and hopefully, 13.2 should be released soon! Screen Shot 2021-11-26 at 5 16 19 PM

rudrankriyam avatar Nov 26 '21 11:11 rudrankriyam

Hi @rudrankriyam Sorry for the late reply 🙁 As I said, we will add this feature to our top-priority list. But I still can't give you an estimate, let's keep in touch 🤝

suriksarkisyan avatar Dec 08 '21 11:12 suriksarkisyan

Hi @suriksarkisyan!

I read this proposal on Concurrency Interoperability with Objective-C, and it has been implemented in Swift 5.5.

So, I don't think you require to add support for it?

I can use it like:

if #available(iOS 13, *) {
      let (result, canceled) = try await Qonversion.purchaseProduct(product)
      
      let permissions = try await Qonversion.restore()
      
      let offerings = try await Qonversion.offerings()
}

And so on.

I plan to use them in my app this weekend and let you know how it goes!

rudrankriyam avatar Jan 20 '22 15:01 rudrankriyam

Hi @rudrankriyam Looks awesome. I'll wait for your feedback about that 🤝

suriksarkisyan avatar Jan 21 '22 15:01 suriksarkisyan

Hi @suriksarkisyan ,

I found out that the function purchase throws an error if the user has cancelled the payment flow. let (entitlements, isCancelled) = try await qonversion.purchase(product.identifier)

However, I would expect that if the user cancelled the payment, that the function would not throw an error since this would be stored in the isCancelled property of the tuple.

Do you plan to change this behavior or should I make a custom implementation?

Thanks!

LucasAbijmil avatar May 03 '23 15:05 LucasAbijmil