diff --git a/src/providers/app.ts b/src/providers/app.ts index b8c038e17..a9caff891 100644 --- a/src/providers/app.ts +++ b/src/providers/app.ts @@ -17,6 +17,7 @@ import { Platform, App, NavController, MenuController } from 'ionic-angular'; import { Keyboard } from '@ionic-native/keyboard'; import { Network } from '@ionic-native/network'; import { StatusBar } from '@ionic-native/status-bar'; +import { Device } from '@ionic-native/device'; import { CoreDbProvider } from './db'; import { CoreLoggerProvider } from './logger'; @@ -178,6 +179,7 @@ export class CoreAppProvider { zone: NgZone, private menuCtrl: MenuController, private statusBar: StatusBar, + private device: Device, appRef: ApplicationRef) { this.logger = logger.getInstance('CoreAppProvider'); @@ -390,7 +392,7 @@ export class CoreAppProvider { * @return Whether the app is running in an Android mobile or tablet device. */ isAndroid(): boolean { - return this.platform.is('android'); + return this.isMobile() && this.device.platform.toLowerCase() == 'android'; } /** @@ -410,7 +412,7 @@ export class CoreAppProvider { * @return Whether the app is running in an iOS mobile or tablet device. */ isIOS(): boolean { - return this.platform.is('ios'); + return this.isMobile() && this.device.platform.toLowerCase() == 'ios'; } /**