Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
2.4.1
-
None
-
Windows 10 Mobile 10.0.14393 Emulator
Windows 10 Mobile 10.0.14393 Microsoft Lumia 435
Windows Universal Platform
Windows Target Version: 8.1
Description
Whenever we run the plugin on a Windows 10 Mobile device, it will use the deprecated APIs and throw this warning:
The method Windows.Storage.Pickers.FileOpenPicker.pickSingleFileAndContinue has been deprecated. Instead, use PickSingleFileAsync
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:
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
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
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.