jamesmontemagno / InAppBillingPlugin

Cross-platform In App Billing Plugin for .NET

Home Page:http://xamarin.com/plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InAppBillingImplementation.PurchaseAsync() bombing

dcurtisgit opened this issue · comments

Our app has used the prior version for several years now, no code changes in calling your library. We downloaded the new version of your library, but are getting a runtime error on iOS and Android. Below is the debug info.
Please advise on how to fix on our end, but since the error is in your library, we probably need a new fixed version.
Thanks

The error:
{Plugin.InAppBilling.InAppBillingPurchaseException: An unknown error occurred at
Plugin.InAppBilling.InAppBillingImplementation.PurchaseAsync (System.String productId,
Plugin.InAppBilling.ItemType itemType, System.String applicationUserName) [0x0017a] in D:\a…}
Plugin.InAppBilling.InAppBillingPurchaseException

Message: An unknown error occurred
Source: mscorlib
Stack trace:
at
Plugin.InAppBilling.InAppBillingImplementation.PurchaseAsync (System.String productId, Plugin.InAppBilling.ItemType itemType, System.String applicationUserName) [0x0017a]
in D:\a\1\s\src\Plugin.InAppBilling\InAppBilling.apple.cs:427
at Plugin.InAppBilling.InAppBillingImplementation.PurchaseAsync (System.String productId, Plugin.InAppBilling.ItemType itemType, System.String obfuscatedAccountId, System.String obfuscatedProfileId, System.String subOfferToken) [0x00036]
in D:\a\1\s\src\Plugin.InAppBilling\InAppBilling.apple.cs:321
at NineTimesProject.Services.InAppPurchase.Purchasesubscription () [0x00322]
in /Users/dean/Documents/DHT_NineTimesApp/NineTimes/NineTimes/Services/InAppPurchase.cs:159

Bug Information

Version Number of Plugin: 7.0.5
Device Tested On: Android Tablet, latest version
Simulator Tested On: iOS iPhone 14 iOS 16.2
Version of VS: 17.5.4 on mac, latest version on PC
Version of Xamarin: 16.2.0.5 Visual Studio Professional
Versions of other things you are using: n/a

Steps to reproduce the Behavior

Make a call to InAppBillingImplementation.PurchaseAsync()

Expected Behavior

For it not to bomb

Actual Behavior

Bobms with unknown error

Code snippet

var billing = CrossInAppBilling.Current;

var purchase = await billing.PurchaseAsync(productId, ItemType.InAppPurchaseConsumable);

Screenshotst

n/a

I found the documentation web page, read thru it. I understand that the lib will not work on the simulator. On Android tablet, PurchaseAsync() just shows a dialog to the user that says "Error" with no other text. My Catch() is not displaying this dialog. In the section "Android Testing" I see a few things that I might be doing, hard to tell. If all else fails I will publish to the Google store and test on Production. Someone please at least follow up with some advice. We have a Nov 1 deadline according to Google. Thanks

On iOS you can test on device or publish to test flight for easy testing.

For android you can put it in Internal testing in google play as well

Thanks for the response. I did publish to Google play to test in Prod. Do you have any thoughts on why PurchaseAsync() is throwing an undefined error on an Android tablet? The user dialog pops up when the lib method is called, not in my Catch() statement. We did not change any of our code, simply upgraded the lib via NuGet and rebuilt. Old version worked fine.

iOS test on my device worked fine. I suspect the android test from the app store will work too.
My guess is the android tablet is throwing an error because of this from the help "Add a test account to the app, ensure it is the main account on device, and that account is opted-in as tester".
Thanks for you help.