is there any phone support - I spend a day trying with both cocoa and swift package manager - nothing seems to work.
), could you tell us more about the problems you’re facing?
I managed to install using swift package manager. The problem I have now is tutorials seem out of date - the updates have deprecated “Purchases.shared.products(tproductID!])” to Purchases.shared.getProducts” but now the Purchases.shared.purchaseProduct does not accept SKProduct type and can’t convert to StoreProduct type.
Is there a conversion call OR is there another version of Purchases.shared to use with StoreProduct type.
I’m happy to update any documentation that we own, could you provide us links to the things that are out of date?
As for purchasing:
Purchases.shared.getProducts
returns StoreProducts, so the objects returned from there should be the ones you pass in to Purchases.shared.purchaseProduct
This simple code generates a conversion “error Cannot convert value of type 'StoreProduct' to expected argument type 'SKProduct' “
Purchases.shared.getProducts(cproductID!]) { (products) in
if !products.isEmpty {
let skProduct = products0]
print("SkProduct \(skProduct)")
Purchases.shared.purchaseProduct(skProduct) { (transaction , purchaserInfo, error, userCancelled) in
if error == nil && !userCancelled {
successfulPurchase()
}
}
Ohh, I see, my bad.
The new method that takes in a StoreProduct is actually this one:
Purchases.shared.purchase(product: storeProduct)
, not Purchases.shared.purchaseProduct: skProduct)
.
I realize that this is confusing, I apologize.
Thanks Andy, big help - I think its just getting started that’s hard.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.