Я разработал Windows Universal App для Windows 8.1. Это приложение работает в соответствии с ожиданиями в Windows Store (в том числе при покупке приложений)
Однако я столкнулся с проблемами в Windows Phone Store. На устройстве (под управлением Windows Phone 8.1) это сообщение: Не удается найти элемент в каталоге; Мы посмотрели, но не можем найти товар, который вы хотели купить. , отображается при попытке покупки в приложении.
public sealed partial class MainPage : Page
{
public event EventHandler<MainPageSizeChangedEventArgs> MainPageResized;
private String ProductId = "focusmedica.ud.cabg";
private String[] video = { "Video1",
"Video2",
"Video3",
"Video4",
"Video5"
};
LicenseChangedEventHandler licenseChangeHandler = null;
public MainPage()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Enabled;
SizeChanged += MainPage_SizeChanged;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//await LoadInAppPurchaseProxyFileAsync();
}
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
if (licenseChangeHandler != null)
{
CurrentApp.LicenseInformation.LicenseChanged -= licenseChangeHandler;
}
base.OnNavigatingFrom(e);
}
public void NotifyUser(string strMessage, NotifyType type)
{
}
private async void BuyProduct2_Click(object sender, RoutedEventArgs e)
{
LicenseInformation licenseInformation = CurrentApp.LicenseInformation;
if (!licenseInformation.ProductLicenses[ProductId].IsActive)
{
NotifyUser("Buying Product 2...", NotifyType.StatusMessage);
try
{
await CurrentApp.RequestProductPurchaseAsync(ProductId);
if (licenseInformation.ProductLicenses[ProductId].IsActive)
{
NotifyUser("You bought Product 2.", NotifyType.StatusMessage);
foreach (String s in video)
{
Button button = (Button)FindControl<Button>(masterHub, s);
button.Visibility = Visibility.Collapsed;
}
}
else
{
NotifyUser("Product 2 was not purchased.", NotifyType.StatusMessage);
}
}
catch (Exception)
{
NotifyUser("Unable to buy Product 2.", NotifyType.ErrorMessage);
}
}
else
{
NotifyUser("You already own Product 2.", NotifyType.ErrorMessage);
foreach (String s in video)
{
Button button = (Button)FindControl<Button>(masterHub, s);
button.Visibility = Visibility.Collapsed;
}
}
}
Я новичок в разработке приложений для Windows Store и даже новичок в разработке Windows Phone. Любая помощь будет оценена.
Мы должны проверить, правильно ли созданы продукты In-app в магазине Windows Phone, а также проверить, что productId верен или нет.