Skip to content

bug: Windows Phone not correctly detected via ionic.Platform.isWindowsPhone() #4070

Closed

Description

@PhilHannent

Type: bug

Platform: mobile webview

I am working on getting my App ported to the wp8. However when trying to debug a Windows Phone specific issue I tried to use the ionic.Platform.isWindowsPhone() function.

However this returns false, and actually returns true for isAndroid. The Cordova device.platform reports as "android" as well.

Looking at the code:
https://github.com/driftyco/ionic/blob/master/js/utils/platform.js#L247

And the User Agent string the device is reporting:
Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 735) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

I see the problem. My Lumia 735 is claiming its ALL three devices. Effectively making it useless. Any chances you could make the "Windows Phone" check the first in the list?

Activity

  1. changed the title [-]Windows Phone not correctly detected via ionic.Platform.isWindowsPhone()[/-] [+]bug: Windows Phone not correctly detected via ionic.Platform.isWindowsPhone()[/+] on Jul 10, 2015
  2. mhartington commented on Jul 14, 2015

    @mhartington
    Contributor

    Hmm, so even using the raw cordova plugin returns android?

  3. added
    needs: reply
    on Jul 14, 2015
  4. PhilHannent commented on Jul 22, 2015

    @PhilHannent
    Author

    On Lumia 735 the device.platform returns Win32NT

  5. removed
    needs: reply
    on Jul 22, 2015
  6. Ionitron commented on Oct 20, 2015

    @Ionitron
    Collaborator

    Greetings @PhilHannent!

    I've closed this issue because my sensors indicated it was old and inactive, and may have already been fixed in recent versions of Ionic. However, if you are still experiencing this issue, please feel free to reopen this issue by creating a new one, and include any examples and other necessary information, so that we can look into it further.

    Thank you for allowing me to assist you.

  7. added a commit that references this issue on Oct 20, 2015
    76189f4
  8. added a commit that references this issue on Dec 6, 2015
    a03b51b
  9. locked and limited conversation to collaborators on Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions