You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we look at this functions we can see that the "mobile" condition is checked in two different ways (with matchMedia and testUserAgent). When I run the app on a Mi phone device it returns true for platform.is('tablet') because testUserAgent(win, /mobile/i) returns false.
The text was updated successfully, but these errors were encountered:
davidperis92
changed the title
bug: platform.is('tablet') returns false when running on an android phone device.
bug: platform.is('tablet') returns true when running on an android phone device.
Jan 14, 2020
Thanks for the issue. I am going to close this in favor of #19737.
Due to inconsistencies between platforms and across devices, it is not easy to achieve a 100% success rate with platform detection. For example Android phones typically have mobile in their user agent string; however, a small number of Android phones do not.
We have opted instead to allow developers to override our platform detection methods with other methods that better suit an application's use case.
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.
Bug Report
Ionic version:
[x] 4.11.8
Current behavior:
platfrom.is('tablet')
returns true when running on an android phone deviceExpected behavior:
It should return true only when is runt on a tablet device.
Steps to reproduce:
Run an app that uses platform.is('tablet') on an android phone and watch the returned value of the function.
Related code:
File in github repository:
core/src/utils/platform.ts
If we look at this functions we can see that the "mobile" condition is checked in two different ways (with matchMedia and testUserAgent). When I run the app on a Mi phone device it returns true for
platform.is('tablet')
becausetestUserAgent(win, /mobile/i)
returns false.The text was updated successfully, but these errors were encountered: