locked
In app purchase - code sample changes before submission RRS feed

  • Question

  • I am following the in-app purchase sample and have it all working and tested as I want it to be. Now I am not sure what code changes to make (apart from changing all CurrentAppSimulator to CurrentApp). Do I keep the LoadInAppPurchaseProxyFileAsync() method? If not, where do I declare the

    LicenseInformation.LicenseChanged event handler?

    Also, do I need to display the listing information in my app? Or can I simply have an appbar button "Buy Ad Free version" and when user clicks it straight away call RequestProductPurchaseAsync()? Will the store display product listing info before actually completing the purchase?

    Thanks

    DK

    Thursday, October 11, 2012 4:08 AM

All replies

  • Hi.

    You don't need to show your user the IAP price. RequestProductPurchaseAsync() will show it to the user.

    My advice about CurrentApp(Simulator) and proxy files in #if DEBUG statements like this:

    #if DEBUG
                    await LoadOnFirstUseAsync();
                    LicenseInformation licenseInformation = CurrentAppSimulator.LicenseInformation;
    #else
                    LicenseInformation licenseInformation = CurrentApp.LicenseInformation;
    #endif

    Where LoadOnFirstUseAsync is loading proxy files for simulator.

    Similiar code for purchase:

    #if DEBUG
                    await CurrentAppSimulator.RequestProductPurchaseAsync(pFeatureKey, false);
    
    // Simulate purchase delay
    await Task.Delay(1500); #else await CurrentApp.RequestProductPurchaseAsync(pFeatureKey, false); #endif

    Sunday, April 28, 2013 6:28 PM