I am trying to implement in-app purchase for my Windows Store App (Metro App). I was referring to the code samples here, but when I triggered the RequestProductPurchaseAsync
method nothing happens.
When I say nothing happens, it means literally nothing. No return results (the result was supposed to be a receipt since I passed in true
for includeReceipt
). Also, when I re-checked the ProductLicences[string].IsActive
flag it will always return me false.
How do I test this out properly? Thanks a lot!
Make sure the app LicenseInformation.IsTrial is false, otherwise it won't work. In-app product purchases require that the app not be in trial. In a published app, the user would see an error stating that you can't do in-app product purchases under trial license. The simulator doesn't show this warning in the in-app purchase simulation dialog during testing.
You can either modify the initial state of the simulation (see the samples for how to do that) or call RequestAppPurchaseAsync(false) during the simulation run to get a full license for the app, then try the product purchase.