locked
During In App purchase i have exception 0x80070005 E_ACCESSDENIED RRS feed

  • Question

  • Hi,

    i writing code to add In App purchase to my app, i can retrive correctly the list of In App products, but when i run the function PurchaseAsync i have this error exception 0x80070005 E_ACCESSDENIED.

    Why ?

    I using Xamarin and PlugIn.InAppBilling multiplatform from Montemagno that work perfectly with Android and iOS


    This is my code:

    string idProdottoAcquisto = "PRODUCT_ID_IN_STORE;"

            string[] idProdottiAcquisto = new string[1];

            idProdottiAcquisto[0] = idProdottoAcquisto;

            System.Collections.Generic.IEnumerable<InAppBillingProduct> ProdInfos = await billing.GetProductInfoAsync(ItemType.InAppPurchase, idProdottiAcquisto);

            if (ProdInfos.Count() < 1)
              return false;

            bool RispostaData = false;
            bool RispostaAlert = false;

            Xamarin.Forms.Device.BeginInvokeOnMainThread(async () =>
            {
              RispostaAlert = await DisplayAlert("Confirm", "Do you want buy\n" +
              ProdInfos.ElementAt(0).Name + " (" + ProdInfos.ElementAt(0).Description + ")\n" +
              ProdInfos.ElementAt(0).CurrencyCode + " " + ProdInfos.ElementAt(0).LocalizedPrice, "YES", "NO");

              RispostaData = true;
            });

            while (!RispostaData)
              Thread.Sleep(500);

            if (!RispostaAlert)
              return false;



            InAppBillingPurchase buy = await billing.PurchaseAsync(idProdottoAcquisto, ItemType.InAppPurchase, "Verified");

            if (buy != null && buy.State == PurchaseState.Purchased)
            {
              return true;
            }
            else
              return false;


    Wednesday, October 10, 2018 10:05 AM

All replies

  • For help with Xamarin please post on the Xamarin forums at http://forums.xamarin.com 

    You'll probably need to track down where the access denied comes from to get help on why it occurs. This may require you debug into the plugin to see what exactly it's doing which raises the error.

    Unlikely to be related to this specific problem, but polling on the RispostaData variable is probably not the best way to wait on the result. You should be able to use the Task system to do this more smoothly. It looks like there are several threads on the Xamarin forums with code snippets of how to set this up with BeginInvokeOnMainThread

    Wednesday, October 10, 2018 9:44 PM