Search code examples
cordovafirebaseionic2cordova-pluginsionic3

Identify Platform Browser in Ionic2


i am looking for a solution to identify the platform 'browser' i was hoping that there is a platform.is('browser') like for the other platforms ios, android or windows, but i could find nothing in the docu.

the reason for this is that i am using firebase authentication wrapped in native login plugin if i am in an generated native app.

but because i also want to offer the browser directly to login, for this i want to login by simple angularfire2 login method.

i tried something like this:

if ((!this.platform.is('ios') && !this.platform.is('android')) || this.platform.is('mobileweb')) { this.inBrowser = true; }

so when i open on my android phone my page in chrome it still tries to use the native plugin login :(

thanks in advance for any help!


Solution

  • Install cordova-plugin-device and check device.platform