I just added a simple in-app purchase in my latest app to allow for the user to remove the advertisement. Before releasing the app I wanted to try the in-app purchase function to see if everything worked out as it should. To just try the function you simply have to change your
and run your purchase function. Simple enough.
But this testing function has a limitation in that it resets every time you start the app. I wanted to see how it looked after purchasing and then restarting the app (to make sure the ads were removed on start-up if the purchase had been made).
It turned out it could be done by finding a file on your computer that should be in the following path:
where YOURUSERNAME is, well, your user name and YOURAPPGUID is the identifier for your app (find this in your package.appmanifest file in the packaging section). The file is called WindowsStoreProxy.xml and looks like this:
<?xml version="1.0" encoding="utf-16" ?> <CurrentApp> <ListingInformation> <App> <AppId>00000000-0000-0000-0000-000000000000</AppId> <LinkUri>http://apps.microsoft.com/webpdp/app/00000000-0000-0000-0000-000000000000</LinkUri> <CurrentMarket>en-US</CurrentMarket> <AgeRating>3</AgeRating> <MarketData xml:lang="en-us"> <Name>AppName</Name> <Description>AppDescription</Description> <Price>1.00</Price> <CurrencySymbol>$</CurrencySymbol> <CurrencyCode>USD</CurrencyCode> </MarketData> </App> <Product ProductId="1" LicenseDuration="0"> <MarketData xml:lang="en-us"> <Name>Product1Name</Name> <Price>1.00</Price> <CurrencySymbol>$</CurrencySymbol> <CurrencyCode>USD</CurrencyCode> </MarketData> </Product> </ListingInformation> <LicenseInformation> <App> <IsActive>true</IsActive> <IsTrial>true</IsTrial> </App> <Product ProductId="1"> <IsActive>true</IsActive> </Product> </LicenseInformation> </CurrentApp>
I have highlighted the two lines that you need to edit. Change the ProductId to whatever you’ve named your “product” in your code to and you are ready to test your app with the purchases complete.
Note: If you happen to ruin the file in some way, just remove it and VS will generate a new one for you.