C# windows phone 8.1 inapp购买

C# windows phone 8.1 inapp购买,c#,xaml,windows-phone-8.1,win-universal-app,C#,Xaml,Windows Phone 8.1,Win Universal App,我已经为Windows 8.1开发了一个Windows通用应用程序。此应用按照Windows应用商店中的预期工作(包括应用内购买) 不过,我在Windows Phone应用商店中遇到了一些问题。在设备(运行Windows Phone 8.1)上,此消息:在目录中找不到项;我们已查找,但找不到您想要购买的商品。在尝试应用内购买时显示 public sealed partial class MainPage : Page { public event EventHandler<Mai

我已经为Windows 8.1开发了一个Windows通用应用程序。此应用按照Windows应用商店中的预期工作(包括应用内购买)

不过,我在Windows Phone应用商店中遇到了一些问题。在设备(运行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;

            }
        }
    }
公共密封部分类主页面:第页
{
公共事件事件处理程序MainPageResized;
私有字符串ProductId=“focusmedica.ud.cabg”;
私有字符串[]视频={“Video1”,
“视频2”,
“视频3”,
“视频4”,
“视频5”
};
LicenseChangeEventHandler licenseChangeHandler=null;
公共主页()
{
this.InitializeComponent();
this.NavigationCacheMode=NavigationCacheMode.Enabled;
SizeChanged+=主页面_SizeChanged;
}
受保护的覆盖无效OnNavigatedTo(NavigationEventArgs e)
{
//等待LoadInAppPurchaseProxyFileAsync();
}  
受保护的覆盖无效OnNavigatingFrom(NavigatingCancelEventArgs e)
{
if(licenseChangeHandler!=null)
{
CurrentApp.LicenseInformation.LicenseChanged-=licenseChangeHandler;
}
基于(e)的导航;
}       
public void NotifyUser(字符串strMessage,NotifyType)
{
}
私有异步void BuyProduct2\u单击(对象发送方,RoutedEventTarget e)
{
LicenseInformation LicenseInformation=CurrentApp.LicenseInformation;
如果(!licenseInformation.ProductLicenses[ProductId].IsActive)
{
NotifyUser(“购买产品2…”,NotifyType.StatusMessage);
尝试
{
等待CurrentApp.RequestProductPurchaseAsync(ProductId);
if(licenseInformation.ProductLicenses[ProductId].IsActive)
{
NotifyUser(“您购买了产品2”,NotifyType.StatusMessage);
foreach(视频中的字符串s)
{
按钮按钮=(按钮)FindControl(masterHub,s);
button.Visibility=Visibility.Collapsed;
}
}
其他的
{
NotifyUser(“产品2未购买。”,NotifyType.StatusMessage);
}
}
捕获(例外)
{
NotifyUser(“无法购买产品2”,NotifyType.ErrorMessage);
}
}
其他的
{
NotifyUser(“您已经拥有产品2.”,NotifyType.ErrorMessage);
foreach(视频中的字符串s)
{
按钮按钮=(按钮)FindControl(masterHub,s);
button.Visibility=Visibility.Collapsed;
}
}
}

我对Windows应用商店应用程序开发相当陌生,甚至对Windows Phone开发也比较陌生。如有任何帮助,我将不胜感激。

我们必须检查应用商店上是否正确创建了应用内产品,并检查productId是否正确。

错误消息显示在哪里?在设备上,应用程序上,在购买是通过一个按钮选择的。我的意思是错误发生在代码中的什么地方:)是的,伙计,如果我知道我现在不会在这里发布,我会吗?:D无论如何,没有引发/显示异常/错误。该应用构建干净。这是在发布的应用中发生的还是在您测试/开发它时发生的?