Xamarin Forms Android Subscription purchase

Viewed 71

We have an XF Forms app that we are adding subscription support for. We implemented Plugin.InAppBilling. Works as expected on iOS. We followed JM's docs for configuring on Android - but getting "This app not configured for subscriptions" error.

This is the purchase method we are using:

public async Task<InAppBillingPurchase> MakePurchase()
    {
        if (!CrossInAppBilling.IsSupported)
            return null;


        var currentPage = GetCurrentPage();
        if(currentPage != null)
        {
            var confirm = await currentPage.DisplayAlert("Q5id subscription", "Become a subscriber to create an alert to find your loved one.","Confirm", "Cancel");
            if (!confirm) return null;
        }
        var billing = CrossInAppBilling.Current;
        try
        {
            var connected = await CrossInAppBilling.Current.ConnectAsync();

            if (!connected)
            {
                //Couldn't connect to billing, could be offline, alert user
                return null;
            }
            //try to purchase item

            
            var purchase = await CrossInAppBilling.Current.PurchaseAsync(SUBSCRIPTION_PRODUCT_ID, ItemType.Subscription);
            deviceService.DeviceLog("PurchaseAsync purchase: ", purchase);
            var isFinish = await CrossInAppBilling.Current.FinishTransaction(purchase);
            deviceService.DeviceLog("PurchaseAsync isFinish: ", isFinish);
            return purchase;
        }
        catch (Exception ex)
        {
            Debug.WriteLine("Error MakePurchase: " + ex.Message);
            deviceService.DeviceLog("Error MakePurchase: ", ex);
            return null;
        }
        finally
        {
            await billing.DisconnectAsync();
        }
    }

We have verified bundleid, Play Console looks right. Any ideas?

0 Answers
Related