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;
Identifies the AppID GUID that corresponds to the named executable. AppIDFlags. Configures how a COM server that is configured to run as the "Interactive User" will be launched or bound to by a client in a non-default desktop. AuthenticationLevel.
Application ID means an application identifier used to tag specific routing applications within the Customer'sRouting Plan.
Every Android app has a unique application ID that looks like a Java package name, such as com. example. myapp. This ID uniquely identifies your app on the device and in Google Play Store. Once you publish your app, you should never change the application ID.
No, AppId
and PackageId
are not identical.
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.
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.)
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
.
To get the Product ID, as Launch the Windows Store app said:
These values can be found in the Windows Dev Center dashboard on the App identity page in the App management section for each app.
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/<your app's Product ID>
.
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.
This should get you what you want:
await Launcher.LaunchUriAsync(new Uri($"ms-windows-store:REVIEW?PFN={Package.Current.Id.FamilyName}"));
The Store will handle the ms-windows-store:
protocol, and the arguments will point it to your app's "Rate and Review" section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With