Ionic platform.is("windows") returning false on windows


#1

Hi,
I just realised that Ionic platform is returning false for Windows in a windows uwp app running on desktop.

When i check the platforms array, it only returns core and cordova.

I believe that this should be an error.

If i am running a windows app on desktop, it should still indicate windows


#2

Hi layinka,

It will be better if you share your code


#3

Here it is

this.platform.is("windows")

This is retruning false, and it should be returning true as i am running a UWP app on windows 10 desktop


#4

Run your app using command ionic lab, because i tried similar way and its working fine for me.


#5

Hi,
I am using TACO with Visual studio 2015, so i dont think i will be able to run this

And also i thought Lab has been discontinued.

Are you testing this with a Windows UWP app build on a windows PC?


#6

You are thinking of Ionic Lab. That product has been discontinued. What @vnyksj was referring to was the Ionic CLI command, ionic serve --lab


#7

Hi,
I will try that, but i dont think it will help, as that wont be running on
windows.


#8

I have the same problem. I’m developing a progressive web app, which, when running in a Windows browser should recognise the Win32 Platform, which it does (Augury inspect). But it still returns false.
Related issues:


I’m actually trying to use <… showWhen=“windows” hideWhen=“mobile” …> together, which is false && false in my desktop browser case.
Adding ?ionicPlatform=windows to the URL will

  1. apply windows styles (haven’t seen those until now)
  2. turn the above statement to true && false, which is also wrong, because it’s not a mobile browser

Shouldn’t work ionic properly without being deployed as a mobile app with cordova, just running in a browser?


#9

I have the same Issue.

VS 2017 with tools for apache cordova. I use cordova 8 with ionic 3.
The app runs on windows, build as x86. Recognized platforms are cordova and core.