Andres Zsogon created CB-13314:
----------------------------------
Summary: Plugin not detecting Windows version correctly
Key: CB-13314
URL: https://issues.apache.org/jira/browse/CB-13314
Project: Apache Cordova
Issue Type: Bug
Components: cordova-plugin-camera
Affects Versions: 2.4.1
Environment: Windows 10 Mobile 10.0.14393 Emulator
Windows 10 Mobile 10.0.14393 Microsoft Lumia 435
*Windows Universal Platform*
*Windows Target Version: 8.1*
Reporter: Andres Zsogon
Priority: Minor
Whenever we run the plugin on a Windows 10 Mobile device, it will use the
deprecated APIs and throw this warning:
{panel:title=Warning|bgColor=#FFFFCE}
The method Windows.Storage.Pickers.FileOpenPicker.pickSingleFileAndContinue has
been deprecated. Instead, use PickSingleFileAsync
{panel}
This occurs because the plugin uses {{navigator.appVersion}} for version
detection, but this only reports the target API, not the actual OS version. So
the plugin thinks this is a Windows 8.1 phone while it's actually a Windows 10
phone.
The {{navigator.appVersion}} is almost the same between the emulators and
devices I've tried, only the {{Trident}} version is increased from {{7}} to
{{8}} in Windows 10 Mobile:
{panel:title=Emulator (WP8.1); Nokia Lumia 520
(WP8.1)|titleBGColor=#29B6F6|bgColor=#E0E0E0}
5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0;
IEMobile/11.0; Microsoft; Virtual) like Gecko
5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0;
IEMobile/11.0; NOKIA; Lumia 520) like Gecko
{panel}
{panel:title=Emulator (10.0.14393); Microsoft Lumia 435
(10.0.14393.1715)|titleBGColor=#00BCD4|bgColor=#E0E0E0}
5.0 (Windows Phone 8.1; ARM; Trident/8.0; Touch; MSAppHost/2.0; rv:11.0;
IEMobile/11.0; Microsoft; Virtual) like Gecko
5.0 (Windows Phone 8.1; ARM; Trident/8.0; Touch; MSAppHost/2.0; rv:11.0;
IEMobile/11.0; Microsoft; Lumia 435) like Gecko
10.0.14393.1715
{panel}
As long as the target API is WP8.1, the plugin will assume it is running on a
WP 8.1 device.
The only solution I found is to check {{device.version}} instead of
{{navigator.appVersion}}, but this requires the device plugin. When
{{device.version}} equals {{6.x}}, it's a Windows Phone 8 device, when it's
{{10.x}} it is Windows 10 Mobile. I assume a PR that depends on the device
plugin will be rejected, so I haven't created it.
Targeting Windows 10 would make the app incompatible with all Windows Phone 8.x
users, so that's not an option.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]