Is the application identifier and package identifier identical?

I want to open the Windows Store of my current application (so that the user can rate / view the application). In doing so, I need to get the application identifier. However, I come across this article in SO , which says that CurrentApp.AppId is time consuming and offers a package identifier as a replacement. I have never released an application in the Windows Store before and cannot test it without a published or published application in the Windows Store.

Can someone help me confirm the following two lines of code?

  //var appId = CurrentApp.AppId.ToString(); var appId = Windows.ApplicationModel.Package.Current.Id; 
+6
source share
2 answers

No, AppId and PackageId not identical.

As you can see, AppId is a Guid structure, and PackageId is a class. AppId is created in the Windows Store when your application is certified to be written to the Windows repository, and PackageId contains package identification information, such as name, version and publisher, which can be found in the appx manifest.

Since AppId is associated with Windows repository, so the first time you are trying to get it, it may take some time. But it will not be too long, in my test it is about 1 second. After that, when you try to get the AppId , it will be very fast. (I think it was saved on the local machine, since its value is invariant.)

However, if you want to run the product details page (PDP) for the product. The product identifier is recommended for clients on Windows 10. And the product identifier is not an AppId .

To get the product ID, Launch the Windows Store app :

These values ​​can be found in the Windows Dev Center toolbar on the App identity page in the application management section for each application.

To get this programmatically, we can try to use the CurrentApp.LinkUri property, this property returns the URI of the application list page in Windows Store as:

https://www.microsoft.com/store/apps/<your app Product ID> .

The product identifier is also invariant, so I think you can just find it in the Windows Dev Center toolbar and make it hard code in your application.

+4
source

This should get what you want:

 await Launcher.LaunchUriAsync(new Uri($"ms-windows-store:REVIEW?PFN={Package.Current.Id.FamilyName}")); 

The ms-windows-store: protocol will be processed in the repository, and the arguments will indicate it in the "Rate and View" section.

+1
source

Source: https://habr.com/ru/post/1244828/


All Articles