Consumables get state purchaseUnavailable
peterwarbo opened this issue · 1 comments
peterwarbo commented
I have used MerchantKit with success with non-consumable products but I'm trying to implement consumable products in my app and the state I get is purchaseUnavailable
for those products.
Not sure what I'm doing wrong.
Using MerchantKit 0.14.0.
Setup code:
func setup() {
let configuration: Merchant.Configuration = {
switch Config.environment {
case .development:
return .usefulForTestingAsPurchasedStateResetsOnApplicationLaunch
case .staging, .production:
return .default
}
}()
merchant = Merchant(configuration: configuration, delegate: self, consumableHandler: self)
merchant.canGenerateLogs = {
switch Config.environment {
case .development:
return true
case .staging, .production:
return false
}
}()
merchant.register(IAPStore.products)
merchant.setup()
productInterfaceController = ProductInterfaceController(products: Set(IAPStore.products), with: merchant)
productInterfaceController.delegate = self
productInterfaceController.fetchDataIfNecessary()
productInterfaceController.automaticallyRefetchIfNetworkAvailabilityChanges = true
update(products: Set(IAPStore.products))
}
Here's a log showing that the non-consumable product (a.x.y) shows up but not the consumable ones.
[Tasks] Started available purchases task for products: ["a.x.y", "b.x.y", "c.x.y", "d.x.y"]
[Tasks] Finished available purchases task: success(MerchantKit.PurchaseSet(storage: ["a.x.y": [Purchase 'a.x.y', price: [Price 12,00 kr]]]))
peterwarbo commented
It was a configuration error on my side.