Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open UWP app from website

Let's start with the background. We are building an app on iOS / Android / Windows where we'll use Firebase Dynamic Links to share content between users (the link looks like this: https://xya.app.goo.gl?link=...). On iOS & Android this can launch the app if it is installed or open Play / Store if not installed yet. This also has the advantage of a graceful fallback to our web app.

Now this isn't natively supported on Windows. There are only following options:

  • Custom URI Schemes (e.g. app://some-link). Not usable because there would be no graceful fallback to our web
  • URI handler - since Anniversary Update app can register a handler for regular http URI. Again not usable because we don't own the domain http://goo.gl which is used for the link

This leads me to only one viable option left - on our web app, detect if user is on Windows. If he is, check if the app is installed and launch it or the Windows Store to let user download it.

Is my thinking correct? If so, how do I launch my app / Store from the web app? It should be possible, it works with Store (when you navigate to Windows Store - e.g. https://www.microsoft.com/en-gb/store/p/... - it opens the store app)

Any ideas? I need two thinks - detect if app is installed & launch it

like image 990
Tomáš Bezouška Avatar asked Apr 22 '26 01:04

Tomáš Bezouška


1 Answers

If you click on a URI with a custom URI scheme, but there is no registered app in Windows for that URI scheme, it will ask to download a supported app from the Store. You can test it with a link to e.g. app://test (linking to non-http(s) websites does not seem to work in StackOverflow, but you can create a simple demo HTML for that).

<html>
<body>
    <a href="app://test">Test link</a>
    <a href="twitter://">Open twitter</a>
</body>
</html>

If an app to handle that URI scheme is installed it will open it, so you need to detect if you're on Windows 10 basically (which is an HTML/JS question I think). And I think this is also what the Windows Store does basically. Because it does not open the Store app for every app (e.g. not for WP8.1 apps if you're on a W10 desktop), that's why I'd guess there is a check on the website.

like image 148
DevAttendant Avatar answered Apr 23 '26 15:04

DevAttendant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!