Monday, January 29, 2024
HomeiOS Developmentios - utilizing async/await for apphud

ios – utilizing async/await for apphud


I am attempting to transform my swift IOS code to make use of async/await. I am calling the perform

let consequence = await Apphud.buy(productId)

however I am getting the error

Can not convert worth of kind ‘String’ to anticipated argument kind ‘ApphudProduct’ after I construct.

I discover that the Apphud SDK has a perform buy(productId) the place it takes a string (which I want) however that is deprecated.

This is the perform from the apphud sdk

@MainActor @objc(purchaseById:callback:)
public static func buy(_ productId: String, callback: ((ApphudPurchaseResult) -> Void)?) {
    ApphudInternal.shared.buy(productId: productId, product: nil, validate: true, callback: callback)
}

Can somebody please assist?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments