3
votes

currently I am new in windows phone 8.1 c# store application development . my application need in-app purchase , I refer so many links on Internet I found documents on windows phone 8 and windows phone 8.1 silverlight apps only , no specific document for windows phone 8.1 store application . as per windows phone 8 document I submit my application as beta app, and create one consumable product , for testing in currentAppsimulator class I have created one testwindoesphone.xml file and working fine but I dont know how to construct code with currentApp class. I have refer msdn , but every time I found 805a0194 error while I used CurrentApp class . please guide me for enalble in-app purchase in my windows phone 8.1 application .

async private void btnCurrentApp_Click(object sender, RoutedEventArgs e)
    {
        LicenceInfo = CurrentApp.LicenseInformation;
        //await CurrentApp.RequestProductPurchaseAsync("PremimumVersion",false);

        if (LicenceInfo.ProductLicenses["PremimumVersion"].IsActive)
        {
            Debug.WriteLine("Already Purchased");
        }
        else
        {
           // await CurrentApp.RequestAppPurchaseAsync(false);
            //await CurrentApp.RequestProductPurchaseAsync("PremimumVersion");
            await CurrentApp.RequestProductPurchaseAsync("PremimumVersion");


            var productLicenses = CurrentApp.LicenseInformation.ProductLicenses;


            MaybeGiveMeGold(productLicenses["Premimum App"], 0);
            //PurchaseResults purchaseResults = await CurrentApp.RequestProductPurchaseAsync();
            //Debug.WriteLine("Purchase Status :: " + purchaseResults.Status);

        }

    }

please let me know that where to put appid or guid in appxmanifest file .

Note: I have already done store association for beta app.

Please help me out for that , sorry for poor English

1

1 Answers

2
votes

First you will call inside your purchase click button

await CurrentApp.RequestProductPurchaseAsync("YourPurchase");

and inside it if its purchased you would execute inside

if (licenseInformation.ProductLicenses["YourPurchase"].IsActive)
{
}

Now you need to make sure that YourPurchase that you created inside your developer account online is running and it will be even shown inside your dashboard online along with your other published apps.