I need to create a web application which will redirect the user to the app store if the mobile device is iOS and it will redirect the user to google play store if the device is android and has google play services like Google Search, google Maps, youtube etc. But if the device is android and do not have google services then it will install an apk.
I was able to detect if the mobile device is iOS from the below code
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
trackViewEvent("iOS");
return "https://apps.apple.com";
}
But now i need to detect if the android application has Google Mobile Services activated. Is this even possible to detect from the browser? Please help