When I use Install-Package Plugin.InAppBilling -Version 4.0.2 in Package Manager Console or updating Plugin.InAppBilling, the enum for ItemType only shows InAppPurchase and Subscription. ItemType.InAppPurchaseConsumable is not found.
public enum ItemType
{
//
// Summary:
// Single purchase (managed)
InAppPurchase = 0,
//
// Summary:
// On going subscription
Subscription = 1
}
Bug Information
Version Number of Plugin: 4.0.2
Device Tested On: Windows 10
Simulator Tested On:
Version of VS: VS 2019 v.16.11.11
Version of Xamarin: 16.11.000.197
Versions of other things you are using:
Steps to reproduce the Behavior
Run Install-Package Plugin.InAppBilling -Version 4.0.2 in Package Manager Console.
Try to use enum ItemType.InAppPurchaseConsumable <-- shows missing
Open ItemType in dll and see only InAppPurchase and Subscription being shown.
Error: ItemType does not contain definition InAppPurchaseConsumable.
Code snippet
public async Task PurchaseItem(string productId)
{
var billing = CrossInAppBilling.Current;
try
{
var connected = await billing.ConnectAsync();
if (!connected)
{
//we are offline or can't connect, don't try to purchase
return false;
}
//check purchases
var purchase = await billing.PurchaseAsync(productId, ItemType.InAppPurchaseConsumable);
//possibility that a null came through.
if(purchase == null)
{
//did not purchase
}
else if(purchase.State == PurchaseState.Purchased)
{
// purchased, we can now consume the item or do it later
// here you may want to call your backend or process something in your app.
var wasConsumed = await CrossInAppBilling.Current.ConsumePurchaseAsync(purchase.ProductId, purchase.PurchaseToken);
if(wasConsumed)
{
//Consumed!!
}
}
}
catch (InAppBillingPurchaseException purchaseEx)
{
//Billing Exception handle this based on the type
Debug.WriteLine("Error: " + purchaseEx);
}
catch (Exception ex)
{
//Something else has gone wrong, log it
Debug.WriteLine("Issue connecting: " + ex);
}
finally
{
await billing.DisconnectAsync();
}
When I use Install-Package Plugin.InAppBilling -Version 4.0.2 in Package Manager Console or updating Plugin.InAppBilling, the enum for ItemType only shows InAppPurchase and Subscription. ItemType.InAppPurchaseConsumable is not found.
public enum ItemType { // // Summary: // Single purchase (managed) InAppPurchase = 0, // // Summary: // On going subscription Subscription = 1 }
Bug Information
Version Number of Plugin: 4.0.2 Device Tested On: Windows 10 Simulator Tested On: Version of VS: VS 2019 v.16.11.11 Version of Xamarin: 16.11.000.197 Versions of other things you are using:
Steps to reproduce the Behavior
Expected Behavior
Actual Behavior
Error: ItemType does not contain definition InAppPurchaseConsumable.
Code snippet
public async Task PurchaseItem(string productId)
{
var billing = CrossInAppBilling.Current;
try
{
var connected = await billing.ConnectAsync();
if (!connected)
{
//we are offline or can't connect, don't try to purchase
return false;
}
} catch (InAppBillingPurchaseException purchaseEx) { //Billing Exception handle this based on the type Debug.WriteLine("Error: " + purchaseEx); } catch (Exception ex) { //Something else has gone wrong, log it Debug.WriteLine("Issue connecting: " + ex); } finally { await billing.DisconnectAsync(); }
Screenshotst