Hi, I followed instructions of this plugin and created test product id on play store to try, ios works, but on Android, PurchaseAsync always threw an exception of InAppBillingPurchaseException: Unable to process purchase, like this,
{Plugin.InAppBilling.Abstractions.InAppBillingPurchaseException: Unable to process purchase.
at Plugin.InAppBilling.InAppBillingImplementation.PurchaseAsync (System.String productSku, System.String itemType, System.String payload, Plugin.InAppBilling.Abstractions.IInAppBillingVerifyPurchase verifyPurchase) [0x00188] in C:\projects\inappbillingplugin\src\Plugin.InAppBilling.Android\InAppBillingImplementation.cs:337
at Plugin.InAppBilling.InAppBillingImplementation.PurchaseAsync (System.String productId, Plugin.InAppBilling.Abstractions.ItemType itemType, System.String payload, Plugin.InAppBilling.Abstractions.IInAppBillingVerifyPurchase verifyPurchase) [0x00108] in C:\projects\inappbillingplugin\src\Plugin.InAppBilling.Android\InAppBillingImplementation.cs:267
I tried on several Android phones and got the same exception. And I tried to do those steps again, no luck. Could someone hit me a clue? Thanks.
My code likes
var billing = CrossInAppBilling.Current;
try
{
var connected = await billing.ConnectAsync(ItemType.Subscription);
if (!connected)
{
return false;
}
// for test
productId = "test_product_id";
var purchase = await billing.PurchaseAsync(productId, ItemType.Subscription, payload);
//possibility that a null came through.
if (purchase == null)
{
//did not purchase
}
else
{
//purchased!
}
}
catch (InAppBillingPurchaseException purchaseEx)
{
//Billing Exception handle this based on the type
// this is where Android threw exception of InAppBillingPurchaseException: Unable to process purchase
Console.WriteLine("Error: " + purchaseEx);
return false;
}
catch (Exception ex)
{
Console.WriteLine("Issue connecting: " + ex);
return false;
}
finally
{
await billing.DisconnectAsync();
}
return true;
Hi, I followed instructions of this plugin and created test product id on play store to try, ios works, but on Android, PurchaseAsync always threw an exception of InAppBillingPurchaseException: Unable to process purchase, like this,
I tried on several Android phones and got the same exception. And I tried to do those steps again, no luck. Could someone hit me a clue? Thanks.
My code likes