Share via


Link To Store App - C# (WinStore,WinPhone)

Today we'll discuss about how to link one of your app with other app available in Store.
For example: If one user tried and enjoyed one of your app, he/she can try remaining of your app too(increase this chance by following this article).

Output: User is using one of your app. You can create some events that can link to your remaining app on store.

How To:
First of all, you need to find out your app id, using browser. i.e. Open Windows Store and Search your app live on Store, and collect app id i.e. If your app link is http://apps.microsoft.com/windows/en-us/app/123abc123 then your app ID is 123abc123

Once you have collected you app id, open your app project in visual studio.
Navigate to specific event that will launch windows store. Copy the following code in event: i.e.
        private async void Button_Click(object sender, RoutedEventArgs e)//Event that will launch windows store
        {
           var uri = new Uri(@"ms-windows-store:PDP?PFN=123abc123");
**           await Windows.System.Launcher.LaunchUriAsync(uri);**
        }
Explanation:
First of all, you need to set uri by using your app id i.e.
var uri= new Uri(@"ms-windows-store:PDP?PFN=YOUR_APP_ID_HERE");
Then launch Uri using System.Launcher. This will launch windows store and search for app id as fast as possible. i.e.
await Windows.System.Launcher.LaunchUriAsync(uri);
Note: Remember to add "async", since this event include "await" process.

Thus, Build and Test your app. I hope you enjoyed! :-)