locked
Detecting if another app is installed.

    Question

  • I have a series of apps which need to be able to determine which of the other app in the series (if any) are installed.  I have researched this and not found a reasonable way to do this.  I have looked at the following:

    1) 'Sharing Contract': http://msdn.microsoft.com/en-us/library/windows/apps/Hh758314.aspx

    This appears to require some sort of user interaction which I don't want.

    2) 'Protocol Activation':  http://msdn.microsoft.com/en-us/library/windows/apps/hh452686.aspx

    I had thought about creating my own protocol and then testing to see if an app exists that can handle that protocol (I do something like that under iOS).  However there does not seem to be a way to test to see if there is an app that can handle a specific protocol, only for launching protocols.

    3) 'Raw Push Notifications': http://msdn.microsoft.com/en-us/library/windows/apps/Hh761488.aspx

    It seems like there might be something there, but it is WAY to complicated for my simple need.

    Is there some other approach that I am missing?  I am easily able to do this under both iOS and Android.

    Thanks.

    Sunday, February 24, 2013 1:00 AM

Answers

  • Hi John,

    Windows Store apps are deliberately isolated from each other and from the system. There is no direct way for a Windows Store app to tell if another app is installed.

    What is the scenario that your app needs to know this? There may be a better way to achieve that. For example, if you want to make sure the app is available to launch via a URI you could call LaunchUriAsync and provide the expected app information in the LauncherOptions. If nobody handles your protocol then the user can be offered the opportunity to install the app.

    --Rob

    • Proposed as answer by Jesse Jiang Thursday, February 28, 2013 2:54 AM
    • Marked as answer by Jesse Jiang Friday, March 1, 2013 2:43 AM
    Sunday, February 24, 2013 3:49 AM
    Owner

All replies

  • Hi John,

    Windows Store apps are deliberately isolated from each other and from the system. There is no direct way for a Windows Store app to tell if another app is installed.

    What is the scenario that your app needs to know this? There may be a better way to achieve that. For example, if you want to make sure the app is available to launch via a URI you could call LaunchUriAsync and provide the expected app information in the LauncherOptions. If nobody handles your protocol then the user can be offered the opportunity to install the app.

    --Rob

    • Proposed as answer by Jesse Jiang Thursday, February 28, 2013 2:54 AM
    • Marked as answer by Jesse Jiang Friday, March 1, 2013 2:43 AM
    Sunday, February 24, 2013 3:49 AM
    Owner
  • Thanks for the response

    I have already looked at the LaunchUrlAsync solution and it is not ideal.  I have a series of apps, some of which are free and some of which are paid.  I have it set up so that if a user purchases any of the paid apps, then extra content is unlocked in the free apps.  Hence the free apps need to be able to tell if any of the paid apps are installed, and ideally this would be done without the user's interaction.  If you had a 'CanLaunchUrl' function that tested if there were any apps that could handle a custom protocol (without actually launching them), then this would work (this is what I do on iOS).

    Thanks


    Sunday, February 24, 2013 3:23 PM
  • For that use I'd look into a custom web service. Even if the user has purchased one of the paid apps, the user may not have installed it on the local machine.

    --Rob

    Monday, February 25, 2013 2:41 AM
    Owner
  • I don't think that asking that they install the app on their device to unlock the additional puzzles is too onerous, but being able to determine if they actually purchased it would be even better.  Can you point me in the right direction.  How can I determine if my user has purchased one of my other apps?

    Thanks.

    Monday, February 25, 2013 3:40 AM
  • There is no direct way to do so. As I mentioned, I would have a web service that the purchased apps could report to and the other apps could query from.

    You're basically routing around the store's commerce system here. Having dependencies between apps is explicitly against the model, so you'll have to implement that yourself.

    --Rob

    Monday, February 25, 2013 6:05 AM
    Owner
  • Without some support from Microsoft, I don't really see how I could cross reference user purchases.  If I had a unique device id (which I don't believe I do?), I might be able to do it on a device by device basis, but that would still require the user to install both apps on the device to get it to work.  Otherwise I am at a loss as to how to implement your suggestion. 

    Thanks.

    Monday, February 25, 2013 3:53 PM
  • You can provide a web service that the user can log into (from within the app - you might leverage the Web authentication broker and single sign-on) and which can keep track of the user's purchases. If the user logs in from a purchased app the app can notify the server of the purchase.

    As I mentioned before, this doesn't fit in to the model of stand-alone apps, so there is no built-in ability to do this. I cannot comment on whether this will pass certification or not. Using your own commerce system on the server should, but tying features between apps may not.

    --Rob

     

    Monday, February 25, 2013 10:58 PM
    Owner
  • Ok, thanks.  I think that I will just forgo this feature for the Windows versions of my apps.  Pity.
    Tuesday, February 26, 2013 5:06 PM
  • You could have a file on the PC that is updated when new apps are added.

    It could keep a list of apps.


    n.Wright

    Tuesday, February 26, 2013 9:37 PM
  • I don't believe that is possible.  As far as I can tell, if I want to write to a file that is outside my sandbox, it will always involve user interaction.  Correct me if I am wrong.
    Wednesday, February 27, 2013 2:40 PM
  • I don't believe that is possible.  As far as I can tell, if I want to write to a file that is outside my sandbox, it will always involve user interaction.  Correct me if I am wrong.

    No I save files in the pictures folder for later use.

    They aren't lost when the program ends.


    n.Wright

    Wednesday, February 27, 2013 9:43 PM
  • Apps cannot share files privately, only to user centric areas. For your licensing use you probably don't want a file that the user is expected to know about and that the user can move, modify or delete.

    Access to libraries (e.g Pictures or Music) can be declared in a capability and used without further user interaction, but those locations are appropriate only for specific file types.

    --Rob

    Wednesday, February 27, 2013 10:28 PM
    Owner