Skip to content

Commit 76189f4

Browse files
author
Phil Hannent
committed
Fixes #4070 because Windows Phone reports itself as being "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" which means Android is picked before "windows phone"
1 parent 6101d4b commit 76189f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: js/utils/platform.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@
249249
platformName = n.toLowerCase();
250250
} else if (getParameterByName('ionicplatform')) {
251251
platformName = getParameterByName('ionicplatform');
252+
} else if (self.ua.indexOf('Windows Phone') > -1) {
253+
platformName = WINDOWS_PHONE;
252254
} else if (self.ua.indexOf('Android') > 0) {
253255
platformName = ANDROID;
254256
} else if (/iPhone|iPad|iPod/.test(self.ua)) {
255257
platformName = IOS;
256-
} else if (self.ua.indexOf('Windows Phone') > -1) {
257-
platformName = WINDOWS_PHONE;
258258
} else {
259259
platformName = self.navigator.platform && navigator.platform.toLowerCase().split(' ')[0] || '';
260260
}

0 commit comments

Comments
 (0)