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

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 Likes

Change Device Mode on inspect element

1 Like

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')){ }

2 Likes

Thanks, this was my problem