locked
In-app purchases wont work

    Question

  • I used the app simulator on my apps and they worked but now they are broke in the store. I change the code to the use CurrentApp. My phone app says the app purchase couldn't be found in the catalogue even though I added it as a product in the dev center. I'm not sure if the content type matters. Please help.
    Saturday, March 28, 2015 12:27 AM

Answers

  • I figured it out, hope this helps someone.

    First problem: when calling CurrentApp.RequestProductPurchaseAsync() I would get "Can't find item in catalog ; We looked but can't find the item you wanted to buy" or error 805a0194.

    Second problem: Couldn't find a way to get if my purchase was active or not.

    Solution to problem one: go to your Package.appxmanifest and right click then hit view code. if your app was already published like mine was go to the dashboard and get the AppId from the Windows Phone dashboard->apps->YourApp->Details. Paste that id into the PhoneProductId field in the Package.appxmanifest. Now your in app purchases should work as long as you published the product in the store and product id you supplied to the method matches.

    Solution to Problem 2: I used this bit of code to see if the purchase was active:

    private async Task<bool> GetLicenseStatus(string id)
    {
        try
        {
            var result = await   CurrentApp.GetProductReceiptAsync(id);
        }
    
        catch //user didnt buy
        {
                return false;
        }
    
        return true;
    }

      

                 




    • Edited by slycoder127 Sunday, March 29, 2015 1:59 AM
    • Marked as answer by slycoder127 Sunday, March 29, 2015 1:59 AM
    Sunday, March 29, 2015 1:57 AM

All replies

  • I figured it out, hope this helps someone.

    First problem: when calling CurrentApp.RequestProductPurchaseAsync() I would get "Can't find item in catalog ; We looked but can't find the item you wanted to buy" or error 805a0194.

    Second problem: Couldn't find a way to get if my purchase was active or not.

    Solution to problem one: go to your Package.appxmanifest and right click then hit view code. if your app was already published like mine was go to the dashboard and get the AppId from the Windows Phone dashboard->apps->YourApp->Details. Paste that id into the PhoneProductId field in the Package.appxmanifest. Now your in app purchases should work as long as you published the product in the store and product id you supplied to the method matches.

    Solution to Problem 2: I used this bit of code to see if the purchase was active:

    private async Task<bool> GetLicenseStatus(string id)
    {
        try
        {
            var result = await   CurrentApp.GetProductReceiptAsync(id);
        }
    
        catch //user didnt buy
        {
                return false;
        }
    
        return true;
    }

      

                 




    • Edited by slycoder127 Sunday, March 29, 2015 1:59 AM
    • Marked as answer by slycoder127 Sunday, March 29, 2015 1:59 AM
    Sunday, March 29, 2015 1:57 AM
  • Hi slycoder127,

    Thanks for sharing the solution.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 7, 2015 3:10 AM
    Moderator