AppId 和 Package Id 是否相同? [英] Are AppId and Package Id identical?

查看:35
本文介绍了AppId 和 Package Id 是否相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打开我当前应用程序的 Windows 应用商店(以便用户可以评价/审查应用程序).为此,我需要获取 App ID.但是,我遇到了这篇文章CurrentApp.AppId 需要很多时间,并提供包 ID 作为替代.我以前从未在 Windows 应用商店上发布过应用程序,如果没有在 Windows 应用商店上发布/发布的应用程序,我现在无法对其进行测试.

I want to open Windows Store of my current application (so the user can rate/review out app). In doing so, I need to get the App ID. However, I come across this article in SO that says CurrentApp.AppId takes a lot of time, and offer Package ID as substitution. I have never released a app on Windows Store before, and cannot test it now without a released/published app on Windows Store.

谁能帮我确认一下下面两行代码?

Can anyone help me confirm about the following two lines of code?

        //var appId = CurrentApp.AppId.ToString();
        var appId = Windows.ApplicationModel.Package.Current.Id;

推荐答案

不,AppIdPackageId 不相同.

No, AppId and PackageId are not identical.

如您所见,AppId 是一个 Guid 结构,而 PackageId 是一个类.AppId 由 Windows 应用商店生成,当您的应用已通过在 Windows 应用商店中列出的认证,而 PackageId 提供包标识信息,例如名称、版本和发布者.可以在您的 appx 清单中找到.

As you can see AppId is a Guid structure while PackageId is a class. AppId is generated by the Windows Store when your app has been certified for listing in the Windows Store, while PackageId provides package identification info, such as name, version, and publisher which can be found in your appx manifest.

由于 AppId 与 Windows Store 相关,所以第一次尝试获取它可能需要一些时间.但这不会太长,在我的测试中大约是 1 秒.此后,当您再次尝试获取AppId 时,会非常快.(我认为它已经存储在本地机器中,因为它的值是不变的.)

As the AppId is related to the Windows Store, so the first time when you try to obtain it, it may takes some time. But this won't be too long, in my test it's around 1 second. After this, when you try to obtain the AppId again, it will be very quick. (I think it has been stored in local machine as its value is invariant.)

但是,如果您想启动产品的产品详细信息页面 (PDP).建议使用 Windows 10 的客户使用产品 ID.产品 ID 不是 AppId.

However, if you want to launches the product details page (PDP) for a product. Product ID is recommended for customers on Windows 10. And the Product ID is not the AppId.

要获取产品 ID,如 LaunchWindows 应用商店应用说:

To get the Product ID, as Launch the Windows Store app said:

这些值可以在 Windows Dev Center 仪表板的 应用标识<每个应用的应用管理部分中的/a> 页面.

These values can be found in the Windows Dev Center dashboard on the App identity page in the App management section for each app.

要以编程方式获取,我们可以尝试使用 CurrentApp.LinkUri 属性,此属性返回 Windows 应用商店中应用程序列表页面的 URI,例如:

To get it programmatically, we can try to use CurrentApp.LinkUri property, this property returns the URI of the app's listing page in the Windows Store like:

https://www.microsoft.com/store/apps/<您的应用的产品 ID>.

产品 ID 也是不变的,所以我认为您可以在 Windows Dev Center 仪表板中找到它并在您的应用程序中对其进行硬编码.

The Product ID is also invariant, so I think you can just find it in Windows Dev Center dashboard and hardcode it in your app.

这篇关于AppId 和 Package Id 是否相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆