Skip to content

Wrong platform detected with android 5.1, android 4.4 #17933

Closed

Description

@pipoa

Bug Report

Ionic version:
[x] 4.x

Current behavior:

I have created 3 different simulators all base on Nexus 5X (1080x1920 density 420dpi) but got different platforms message output.
To clarify, it's a mobile phone, not tablet not desktop.

I log the the platforms as command below:
console.log("platforms=>", this.platform.platforms());

with result:

[android 4.4]
platforms=> ["android", "phablet", "cordova", "desktop", "hybrid"]

[android 5.1]
platforms=> ["android","phablet","cordova","desktop","hybrid"]

[android 8]
platforms=> (5) ["android", "phablet", "cordova", "mobile", "hybrid"]

Expected behavior:

should as android 8 output: "mobile" , not "desktop"

Steps to reproduce:

Just print out using command:
console.log("platforms=>", this.platform.platforms());

Activity

  1. changed the title [-]Wrong platform detect with android 5.1, android 4.4[/-] [+]Wrong platform detected with android 5.1, android 4.4[/+] on Apr 2, 2019
  2. liamdebeasi commented on Apr 3, 2019

    @liamdebeasi
    Contributor

    Hi there,

    Thanks for opening an issue with us. This is a known limitation with the way we do platform detection. Unfortunately, in order to fix this issue breaking changes are required.

    I have a proposal for a revamp of platform detection, but this likely won't come until the next major version of Ionic (we follow semantic versioning for releases, so major versions are the only versions with breaking changes). You can view the proposal here: #17631. The thread also lists a library that implements platform detection, so if you are in need of an immediate workaround you might find that library useful.

    I am going to close this issue since the issue is already noted in the thread I attached, but I am going to link these issues together to ensure your use case is covered when we update our platform detection methods.

    Thanks for using Ionic!

  3. ionitron-bot commented on May 3, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  4. locked and limited conversation to collaborators on May 3, 2019
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

    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