I'm trying to enable an in-app purchase item on my app (already on Windows 10 store), but I always receive the same error message when trying to buy this item:
This in-App Purchase item is no longer available in MyAppName
The code is fairly simple and just what the docs recommend:
var itemName = "app.advanced_items.full";
if (CurrentApp.LicenseInformation.ProductLicenses[itemName].IsActive) {
return true;
}
var results = await CurrentApp.RequestProductPurchaseAsync(itemName);
if (results.Status == ProductPurchaseStatus.Succeeded ||
results.Status == ProductPurchaseStatus.AlreadyPurchased) {
return true;
} else {
return false;
}
More information:
- I created and submited the in-app item to the store before building the package as the documentation told me
- The name of the item is the same both on the store and the app (
itemName
on code) - I tried this before submitting to the store
- I tried this after submitting to the store (My app is currently broken there! -- unable to buy the item)
I suspect the problem might be related with the following:
- The app display name (on
Package.appxmanifest
) is not the same app name on the store (The name I wanted was not available so I made it longer, but the app once installed will display the original name). This shorter name is the one in the error message...
I changed the "display name" to the full name of the app, but the error was the same. I don't know if sending it to the store might change this (I and don't want to deploy another buggy version just to test this theory)
Extra: The only resources I found online about this issue were useless and related to Windows 8: link
Suggestions?
Please check with the productId of the IAP. I guess the one you mention in your code is different from the one in the store.
If its the same, I recommend to use the method LoadListingInformationAsync which returns the list of IAP's and then select the required IAP from that list. If there's a name mismatch then you wont be able to retrieve that IAP. So we'll be able to find its because of the naming problem. I have also added a sample code for that. Give a try.
I tried contacting Microsoft about this issue and they asked me to make the IAP unavailable and then make it available again. I must say it did not solve my issue, but if you want to give it a try, follow these steps:
After that, they told me to try making the whole app unavailable to all countries and publish it. Then do the opposite. No success either...
i've got the same problem. In my situation the solution is to add all language description in IAP and then it's works fine
After 2 months talking to Microsoft support they finally fixed something on their side and my IAP started working.
I believe the fix was global, but if your IAP still do not work, contact them to republish it.
Below is an excerpt from the email they sent me:
I had similar issue with my new UWP app, "Midi Player". IAP was available for purchase on WP 8.1 right after certification and publishing but shows same error on W10M (Windows 10 Mobile) platform (I believe, all Windows 10 UWP apps has the same store). I've opened issue with Microsoft but they can't help me. Fortunately, the issue now is gone :) What I did:
So, my conclusion:
I believe the problem here is that you need to differentiate between testing and production. You cannot use production mode unless you are published in the store. See CurrentApp and CurrentAppSimulator.
From the
CurrentAppSimiulator
page:Here is how I solve this in my app with a #define which I change for testing/production, and a proxy class that switches between CurrentApp and CurrentAppSimulator to make my other code much easier on the eyes.
App.xaml.cs, App()
CurrentAppProxy.cs
Usage in my app...
CurrentAppProxy is they key here. If it works with the simulator, it should work with your production items. You just need to have all the other pieces in place for all the various conditions. Some testing is easiest to do in the debugger.