Platform.is('ios') return true in ionic serve


#1

I’m running ‘ionic serve’, then I’m trying to check if a user is running on android or ios so I do exactly as described here but the problem is that platform.is(‘ios’) returns true in the browser (ionic serve). How can I know if I’m running on browser?


#2

Change Device Mode on inspect element


#3

If you want to know whether you are running in the browser or on a device, you could check for the negate of platform.is(‘cordova’). I.e. something like this:

if(!this.platform.is('cordova')){ }


#4

Thanks, this was my problem