我開發了一個包含IAP的免費UWP應用程序。IAP不適用於Win10Mobile的UWP應用程序
我爲Windows 10 Mobile開發了這個應用程序。我發佈了一個名爲customBackground的商店的IAP,並將我的應用以及IAP發佈到商店。
在他們兩人都發布後,我從商店下載了我發佈的應用程序並嘗試購買IAP。
但是,它返回了一個系統彈出窗口,顯示「這個應用內商品不再適用於MY-APP-NAME」。我不知道爲什麼會發生這種情況。
有問題:
當我使用CurrentAppSimulator類,它不彈出我的手機或模擬器上購買狀態選擇正試圖在調試模式下在Visual Studio中,但它會彈出在桌面版上。它只讀取WindowsStoreProxy.xml中的存儲狀態。
我也試着使用在調試/釋放模式CurrentApp類IAP公佈後,但沒有運氣,它返回相同的錯誤店裏版本。
Package.appxmanifest中的Internet權限已啓用。
下面的代碼在我的商店發佈的應用程序:
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;
}
}
謝謝!
我有同樣的問題。你能解決它嗎?也許這只是在發佈應用程序後才暫時,在等待一段時間後一切都會好起來? – tipa
是的,這是暫時的。 – oscarxvita