How to provide a link button to another Metro App in Windows Store

Answered How to provide a link button to another Metro App in Windows Store

  • Thursday, April 05, 2012 3:24 AM
     
     

    I have a "Lite" version of Metro App and a "Full" version Metro App. So in the "Lite" version of Metro App, I want to provide a link that when clicked on, will direct the user to go to the "Full" version Metro App download page in the Windows Store. Is there API or sample code that I can achieve this?

    Thank you very much.

    Angela

All Replies

  • Thursday, April 05, 2012 4:24 AM
     
     

    You cannot vote on your own postWhen you already know the URL of the web page, you can use Launcher.LaunchUriAsync().
    see: "How to launch the default app for a protocol"

    For example, the following URL shows 'SkyDrive App' in a web browser.
    http://apps.microsoft.com/webpdp/en-us/app/skydrive/2682e314-15ab-4510-bbb3-d33da78a44d9
    With IE10 on Win8CP, the user can move to the Windows Store from this page, by clicking the button 'View in Windows Store'.


    biac [ http://bluewatersoft.cocolog-nifty.com/ ]

  • Thursday, April 05, 2012 6:09 AM
     
     

    Hi Biac,

    Thank you for your answer. I have a few more questions about this:

    1. Where can I get the URL, I assume the URL will be given by MS once my Metro App is uploaded into the store?

    2. The Web site of the URL is not inside the Windows Store, but the web site has a link that that can direct the user to go to Windows Store? If so, can we implement the "link on the web site" so that when user clicks on the link on my Metro App, it will direct them to go to Windows Store instead of landing on a intermediate page then go to the store?

    3. In Metro App A, can we initiate search action to Windows Store with some unique identifier that leads to Metro App B?

    Thank you very much.

    Angela

  • Thursday, April 05, 2012 7:44 AM
     
     Answered Has Code

    OK, I investigated further, and found the 'ms-windows-store' protocol.

    For example,

    private async void TestButton_Click_1(object sender, RoutedEventArgs e)
    {
        var uri = new Uri(@"ms-windows-store:PDP?PFN=microsoft.microsoftskydrive_8wekyb3d8bbwe");
        await Windows.System.Launcher.LaunchUriAsync(uri);
    }
    
    This code works fine, then the Windows Store App is displayed immediately.

    About "ms-windows-store:" protocol and "Package Family Name (PFN)", you will get some information from following url: http://blogs.msdn.com/b/windowsstore/archive/2012/02/22/linking-to-your-apps-on-the-web.aspx

    > 1. Where can I get the URL
    See above URL.

    > 2. ... can we implement the "link on the web site" so that when user clicks on the link on my Metro App
    Yes! :-)

    > 3. ... can we initiate search action to Windows Store with some unique identifier
    Sorry, I don't know.


    biac [ http://bluewatersoft.cocolog-nifty.com/ ]

    • Proposed As Answer by biac Thursday, April 05, 2012 7:44 AM
    • Marked As Answer by Angela Yan Thursday, April 05, 2012 8:02 AM
    •  
  • Thursday, April 05, 2012 8:03 AM
     
     

    Thank you Biac. That is very helpful. :)

    Regards,

    Angela

  • Wednesday, May 02, 2012 4:19 PM
     
     

    Hello,

    I am working on a metro app and it features applications in the Windows 8 app store.  When clicked, it needs to launch the specific application in the app store.  The launcher code works correctly, however my problem is that I can not find the PFN. I only have the unique ID number for the app.  Any suggestions?

  • Thursday, May 03, 2012 12:54 AM
     
     

    Hi alex k citi

    I can not find the PFN. I only have the unique ID number for the app.  Any suggestions?

    You can get the PFN of your application from the package.appxmanifest file.

    Probably, the way you get PFN of the others' application does not exist officially. However, after installing the application, you will be able to see %localappdata%\Packages\.


    biac [ http://bluewatersoft.cocolog-nifty.com/ ]