How to check platform "android" & "browser"?

I developed an application that can be run through the browser & It published also on Google Play
So, If users open my app by browser of android phone, i want to check this case to move them to the Google play to download it to use the full features.
Any helps please ?

1 Like

This is what i found in this forum and use in v4:

this.isApp = (!document.URL.startsWith(‘http’) || document.URL.startsWith(‘http://localhost:8080’));

1 Like

Hi @_Ali94 :wave:

I think the easiest way is to import the Platform service from @ionic/angular, inject it in the constructor and then checking for a specific platform like if (this.platform.is('android')) or if (!this.platform.is('cordova')) for the browser.

You can find all the platform names here: https://github.com/ionic-team/ionic/blob/master/angular/src/providers/platform.ts#L91

Best,
Rodrigo

2 Likes

In IONIC v5 If you use this.platform.is('android') returns true if you are using the web app version in an android device. There is a way to know if the user are usign the webApp or the native app?