gpt4 book ai didi

c# - IAP 不适用于 Win10Mobile 的 UWP 应用程序

转载 作者:可可西里 更新时间:2023-11-01 10:44:28 26 4
gpt4 key购买 nike

我开发了一个包含 IAP 的免费 UWP 应用。

我为 Windows 10 Mobile 开发了这个应用程序。我向名为 customBackground 的商店发布了一个 IAP,并将我的应用程序和 IAP 一起发布到商店。

在它们都发布后,我从商店下载了我发布的应用程序并尝试购买 IAP。

但是它返回了一个系统弹出窗口,提示“此应用内商品在我的应用名称中不再可用”。我不知道为什么会这样。

存在问题:

  1. 当我尝试使用 CurrentAppSimulator 类在 visual studio 中的 Debug模式下时,它不会在我的手机或模拟器上弹出购买状态选择,但会在桌面版本上弹出。它只读取 WindowsStoreProxy.xml 中的存储状态。

  2. 我也试过在 IAP 发布后在调试/ Release模式下使用 CurrentApp 类,但运气不好,它返回与商店版本相同的错误。

  3. Package.appxmanifest 中的互联网权限已启用。

这是我在商店中发布的应用程序中的代码:

private async void buy_Click(object sender, RoutedEventArgs e)
{
LicenseInformation licenseInformation = CurrentApp.LicenseInformation;
if (!licenseInformation.ProductLicenses["customBackground"].IsActive)
{
Debug.WriteLine("Buying this feature...");
try
{
await CurrentApp.RequestProductPurchaseAsync("customBackground");
if (licenseInformation.ProductLicenses["customBackground"].IsActive)
{
var purchaseStat = LocalizedStrings.GetString(LocalizedStringEnum.havePurchased);
var b = new MessageDialog(purchaseStat);
b.ShowAsync();
Debug.WriteLine("You bought this feature.");
isIAPValid = true;
}
else
{
var purchaseStat = LocalizedStrings.GetString(LocalizedStringEnum.notPurchased);
var b = new MessageDialog(purchaseStat);
b.ShowAsync();
Debug.WriteLine("this feature was not purchased.");

}
}
catch (Exception)
{
var purchaseStat = LocalizedStrings.GetString(LocalizedStringEnum.purchaseFailed);
var b = new MessageDialog(purchaseStat);
b.ShowAsync();
Debug.WriteLine("Unable to buy this feature.");
}
}
else
{
var purchaseStat = LocalizedStrings.GetString(LocalizedStringEnum.alreadyOwned);
var b = new MessageDialog(purchaseStat);
b.ShowAsync();
Debug.WriteLine("You already own this feature.");
isIAPValid = true;

}
}

谢谢!

最佳答案

一天后,我发现我的 iap 正在工作。这似乎是暂时的问题,微软确实需要改进他们的商店系统。

关于c# - IAP 不适用于 Win10Mobile 的 UWP 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32272167/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com