首页 > 解决方案 > 无法从 Plugin.InAppBilling.ItemType 转换为 bool

问题描述

我使用作者 jamesmontemagno 4.x 版的 InAppBilling 插件。(最后稳定)

按照代码返回错误:无法从 'Plugin.InAppBilling.ItemType' 转换为 'bool'

原始示例方法由 jamesmontemagno

var connected = await billing.ConnectAsync(ItemType.InAppPurchase);

标签: xamarin.formsnuget-packagein-app-billing

解决方案


文档清楚地指出

更改:等待 CrossInAppBilling.Current.ConnectAsync(ItemType.InAppPurchase); 等待 CrossInAppBilling.Current.ConnectAsync();


推荐阅读