Search code examples
xamarin.formsnuget-packagein-app-billing

Cannot convert from Plugin.InAppBilling.ItemType to bool


I use the InAppBilling plugin from the author jamesmontemagno version 4.x. (last stable)

Follow the code return error: Cannot convert from 'Plugin.InAppBilling.ItemType' to 'bool'

Original example Method by jamesmontemagno

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

Solution

  • the docs clearly note

    Change: await CrossInAppBilling.Current.ConnectAsync(ItemType.InAppPurchase); to await CrossInAppBilling.Current.ConnectAsync();