Detecting the OS version then recommended to user to install application - android

I have an android mobile application for the product. I want to display a recommendation message when user open website in android device. Recommendation message should be like For better experience install the mobile application. In that message will provide one link which will open Application if already installed or otherwise redirect on the Play store link.
Actually, I don't have any idea and I don't know where to start. Can you please help me.
Edited:
I have uploaded reference image, In Below image, you can see the highlighted area.

I think that this is possible by reading the User Agent
https://developer.chrome.com/multidevice/user-agent#chrome_for_android_user_agent
If you are parsing user agent strings using regular expressions, the
following can be used to check against Chrome on Android phones and
tablets:
Phone pattern: 'Android' + 'Chrome/[.0-9]* Mobile'
Tablet pattern:
'Android' + 'Chrome/[.0-9]* (?!Mobile)'

Related

PWA - Android, iOS, MacOS, Windows Store, Chrome Add to Home Screen - Problems with multi tenancy app with multi domains

I have couple questions about generating PWA App. Maybe at the first step I explain something about app for better understanding my problems with generating app for multiplatforms.
Multi Tenancy App
I can't say much more about application. This is application where users can create own account. Accounts is separated at servers, eg. app1, app2, app3 etc. Every server has his own domain, eg. app1.example.com etc. Every user can upgrade his account to premium type and define own domain, which can be go on and login to his account without using global domains (here is a problem with PWA app, multi domains). I think it is everything what you need to know, if you need more specific info, give me a feedback, I will try to help you. I need to use WebView because app need access to localStorage.
My problems
Problem is with multi domains. In manifest.json configuration is possible to define one domain, which app will be use to display application and authorize it (with assetlinks.json) to don't display URL Bar (for "Add to Home Screen" - with android app is possible to add wildcard).
I need possibility to use application with multi domains (I achieve it on android - explanation in the following part of post).
Problem is too with adding application from mobile Chrome "Add to Home Screen" and on the desktop "Install app...". After redirect to other URL, URL Bar is shown.
Next problem is to compile Windows Store app from Visual Studio (explanation in the following part of post).
I need more info about compiling app for iOS and MacOS - is this possible to compile and test it without Apple devices? I tried to use pwabuilder.com, but after download MacOS package folder is empty. Maybe virtual machine could help me with that? What you recommend too use to make that application? I tested what I found in google, but it wasn't what I expect.
Installation from Chrome browser
Is possible to change user URL without showing URL Bar? Now after autorization user and redirect him on the properly his premium address url bar is showing - i don't want users to have to go on properly domain and install app from "Add to Home Screen" - they should install it from any domain and use it like Native App.
Android
Partially solved problem with subdomains for every account. It's working properly, but maybe someone has any other authorization solution where I don't need custom subdomain for authorize app.
Windows Store
I installed Visual Studio, make new application with this documentation but I getting error
Error Project must have a reference to an application. Please add a reference under the 'Applications' node in the Solution Explorer.
Here is an issue - Maybe problem is with newest version of Visual Studio? Next question is, even if I compile the App, what with multi domain - URL Bar will be visible when user will be redirected? What if Chrome don't be installed?
iOS and MacOS
Maybe someone has good documentation how to create apps on this platform and where can I test it? What with multi domain? URL Bar will be shown? Is possible to make it invisible like an Android App eg. wildcard or other solution?
My questions
How to create PWA app for iOS and MacOS. Maybe is nice documentation for it.
How to build application for Windows Store. I made app with Microsoft documentation, but it doesn't work - problem was open on GitHub Issue, but without solution.
Is possible to use multi domains and don't show URL Bar for applications installed from mobile Chrome like a "Add to Home" or desktop Chrome "Install app...".
What if Chrome don't be installed on device? Application will be working properly? I know from android 8.1 is possible to remove chrome from android. I don't know if after remove Chrome application will be working?
Thanks everyone for help and your patience, I counting on much help from you.
I'm recently building a PWA with Vue and I'm trying to find a way of making the IOS package out of It. So far I haven't done yet but for Windows, Android & MacOs are pretty easy ... There a lot of blog tutorials for that and if you don't want to go through much of coding then the PWA Builder is the best option for you.
For your 4th question if you want to run a PWA from a browser the browser you have must support standalone desktop apps.
I wanted to try my PWA on iPhone from Chrome and couldn't because that chrome does not have the feature to pin an app to screen so I had to rely on safari only

iOS custom URL schemes vs. Universal Links and Android counterpart

I'm looking for functionality where when a user receives a message - let's say through the WhatsApp app - containing a link starting with a certain scheme (prefix), my app will be invoked when the user taps on that link.
I understand that this feature is already available as "custom URL schemes" but I also noticed now that Universal Links have a similar thing. So, is there any issue with "custom URL schemes"? I don't want to use Universal Links because I don't want my app to be restricted to iOS 9.
Moreover, it looks like Android also has this feature of customer URL, but again, on the latest Android version 6.0, it's mentioned here that they also have "App Links" feature which only works on Android 6.0. So, again, what is the difference between the two?
I don't want to restrict my app to work on only iOS9 or Android 9. So I guess the traditional "custom URL schemes" is more attractive for me for the time being.
Also, I want to make sure that "custom URL schemes" will work when a user taps on a link on WhatsApp or it will only work if the link on the web browser or mail.
URLs with custom schemes don't get displayed as links in many Android applications (SMS, E-Mail, WhatsApp, Hangouts, you name it), which de facto make them unopenable by your application. iOS however does not allow for defining scheme + host + path like android does.
One possible (hacky) solution to this is browser sniffing (I know, evil, but so are non-standard extensions to well-defined behavior, especially if nothing was broken in the first place) at the resource you expose over a URL reachable over HTTP(s).
You could check if the request origins from the iOS-platform you offer native apps for; then you would have to make sure that the device has your application installed (this is getting uglier and uglier; see here for example) and then, only then redirect to yourapp://the-rest-of-your/uri, which causes a prompt shown to the user whether they want to open the address inside the application or not. (Tested on an iPhone 4 with iOS 8, Safari browser.)

Creating web links that will open a website, iOS, Android or Win8 app depending on device

Does anyone have any suggestions for the best way to create a web link that, depending on the device the user is browsing with will direct them to a website (for laptop/desktops), the App Store (for iOS devices), the Play Store (for Android devices) or the Win8 store, with a default to the website if device type is unknown?
At the moment, the best option seems to be to direct users to a website exclusively, with smart banners that will show a link to the App Store on relevant devices using the following code in the site header:
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
But this is inelegant and can be missed by site visitors plus the additional step leads to a high dropoff. Any suggestions or thoughts would be appreciated!
Rather delayed reply but here goes:
Detect which OS is being used using Javascript code. Link
Change the hyperlink based on whether it is an iPhone Android or Windows.
If its iPhone use this, if its Android use this and for Windows use this
Hope that helped!

Mobile detection code

Is is possible to have a code in a web link that detects what mobile platform a user is on eg iPhone/iPad, Andriod, Blackberry etc...
I'm trying to solve a problem at the app company I work at where whenever we do a tweet we include a call to action - a bitly link with the app download link. However because the app is on the Apple app store, Google Play store and Blackberry store we have to do 3 different bitly links to different app stores.
What I want to create is code to detect what platform a user is on and build that into a shortened url. So when we do a tweet, we just do one link and it automatically directs the user to the appropriate app store depending on what device they are using.
Does this exist already? If not how can it be created? Please give me some insights/ideas as to how this could be achieved
Thanks
I think taht you are looking for it http://detectmobilebrowsers.com/ is an open source library to detect the mobile os and more information.
You can detect the which device user is on by using
var userAgent = navigator.userAgent.toLowerCase();

can we install another application from our android apllication?

i am using a augmented reality in my android application.
For this i am using the wikitude api. This api requires the phone to have the wikitude browser installed in our phone. if it is not there is a provision that i can show a message that the apk file is not available on your phone.
When the above message is shown that the wikitude broswer is unavailable on the phone, i want to install the brower on the user's phone using the code in my application.
Right now i am providing a link to the android market where the wikitude browser lies, rather than redirecting him to this url, i want to install the app directly in the phone without the user ever knowing that there is another app being installed in the background from the android market.
is this possible in android?
thank you in advance.
It's actually a bad idea to try to install any kind of software without letting your users know about it. And there are permissions that user must accept, you cannot just overcome this. So the only solution for you is to redirect the user to the market and let him know that he won't be able to use your application without having the other one installed.

Categories

Resources