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:
itemName
on code)I suspect the problem might be related with the following:
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?
Open Microsoft Store and select Profile next to the search box. Select App settings > Purchase sign-in. Turn the switch to On.
All apps ARE NOT necessarily UWP apps. Windows 8.1 apps do run on Windows 10, just not the other way around. Not every company or indie developer has updated their apps to support UWP. All apps that were previously in the store for Windows Phone 8.1 and Windows 8.1 will still run and be available respectively.
In Solution Explorer, open the solution for your UWP app project. Right-click the project and choose Publish->Create App Packages (before Visual Studio 2019 version 16.3, the Publish menu is named Store). If this option is disabled or does not appear at all, check that the project is a Universal Windows project.
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:
We have issued a republish for your IAPs in this app. This should correct the situation as soon as the process completes. You may want to check periodically over the next few hours to see if you are able to confirm the fix worked for you. Let me know what you see.
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.
try
{
var listing = await CurrentApp.LoadListingInformationAsync();
var iap = listing.ProductListings.FirstOrDefault(p => p.Value.ProductId == "removeads");
receipt = await CurrentApp.RequestProductPurchaseAsync(iap.Value.ProductId, true);
if (CurrentApp.LicenseInformation.ProductLicenses[iap.Value.ProductId].IsActive)
{
CurrentApp.ReportProductFulfillment(iap.Value.ProductId);
//your code after purchase is successful
}
}
catch (Exception ex)
{
//exception
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With