Prevent android user from using the website, redirect the user to the app if installed or play store page but allow the user to use the website on all other platforms.
The scenario looks like this.
User installs our PWA app on windows desktop https://test.app.com
He gets a notification from the system and clicks on the link in outlook
https://test.app.com/test/123.
I expect the link to be loaded in PWA while it opens the browser. Is it possible to use intent filters like in android?
I am implementing a PWA application and a native application on Android. I need to open the native app from PWA app which I know how to do that. Basically I need a URL provided from the native app and open the URL from PWA which will bring the native application. This approach is pretty much like opening google map by clicking its url: http://maps.apple.com/?address=1,Infinite+Loop,Cupertino,California..
Now I have a requirement to open my PWA from the native app. For example, if I share the PWA url through facebook, I'd like other people open the PWA app when they click on the url in facebook if they have installed the PWA.
How can I achieve that?.
You don't need to implement anything to do that. Android does it for you. For example, if your PWA is hosted on https://my-pwa.com and the user clicks a link with the href https://my-pwa.com, Android first looks through your PWAs and if the URL matches, it opens the PWA. Otherwise Android opens the Chrome browser.
Just verified this on an Android 6 device.
I have a website that has social icons and is responsive for the mobile view. what I m trying to do is make the social icons (twitter, facebook...), when the web page is opened on mobiles or tablets, to open facebook app if available, if not to open in browser. and to open in browser when on desktop.
Thank you.
How can I have a link to a facebook page open in the FB app on a mobile device and still open in a browser when the fb app is not installed or on a desktop?
You could use media queries to show/hide a link on different screen sizes. Or you could check the window size in javascript and depending on what that is you could change the href to the mobile or desktop site
http://www.w3schools.com/jsref/prop_win_innerheight.asp
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries