TransWikia.com

Unable to fetch inapp products for Xamarin Android using Plugin.InAppBilling package

Stack Overflow Asked by Maximus on January 17, 2021

I’m having trouble retrieving my in-app products for my Android Xamarin app. I’m using the Plugin.InAppBilling nuget package (version 4.0.1-beta) to implement the billing functionality. To begin, I following the documentation which states the following:

Android Testing:
- You MUST use a physical device. Emulators do not work.
- Ensure you have app in Alpha/Beta with the NuGet installed. This will add “com.android.vending.BILLING” permission for you
- Create an IAB product, make sure it is published and active
- Add a test account to the app, ensure it is the main account on device, and that account is opted-in as tester
- Validated your version code and number in your development environment match what is in the Play store.
- You MUST sign the APK even in debug mode.

Therefore I have the following specified in my Android csproj:

enter image description here

This is my aab package in the Play Console in Internal Testing with 2 testers:

enter image description here

enter image description here

Here are the testers also added as Licensed Testers:

enter image description here

However, using the following code doesn’t return any products from the call to GetProductInfoAsync:

private partial async Task FetchProductDetails(bool isAdsDisabled)
{
    var billing = CrossInAppBilling.Current;

    try
    {
        //You must connect
        var connected = await billing.ConnectAsync();

        if (!connected)
        {
            //Couldn't connect
            return;
        }

        var products = await billing.GetProductInfoAsync(ItemType.InAppPurchase, productIds);
        
        .
        .
        .
    }
    catch (Exception ex)
    {
        ...
    }
    finally
    {
        await billing.DisconnectAsync();
    }
}

Anyone know if I missed a step? Something missing?

2 Answers

As mentioned in the documentation, you need an app in Alpha/Beta. Internal testing will not work.

Correct answer by dwey on January 17, 2021

License Response. You have Licensed. I've always used RESPOND_NORMALLY.

I'm not using the plug in as I wrote my own using xamarin.android.google.billingclient3.0.0. All working here.

Well, what happens when you debug GetProductInfoAsync?

Answered by user2153142 on January 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP