From 76189f4dd481fabcc01744fef56b9a4a774aad70 Mon Sep 17 00:00:00 2001 From: Phil Hannent Date: Tue, 20 Oct 2015 13:24:20 +0100 Subject: [PATCH] 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" --- js/utils/platform.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/utils/platform.js b/js/utils/platform.js index 962294d37ab..f25019e0ae8 100644 --- a/js/utils/platform.js +++ b/js/utils/platform.js @@ -249,12 +249,12 @@ platformName = n.toLowerCase(); } else if (getParameterByName('ionicplatform')) { platformName = getParameterByName('ionicplatform'); + } else if (self.ua.indexOf('Windows Phone') > -1) { + platformName = WINDOWS_PHONE; } else if (self.ua.indexOf('Android') > 0) { platformName = ANDROID; } else if (/iPhone|iPad|iPod/.test(self.ua)) { platformName = IOS; - } else if (self.ua.indexOf('Windows Phone') > -1) { - platformName = WINDOWS_PHONE; } else { platformName = self.navigator.platform && navigator.platform.toLowerCase().split(' ')[0] || ''; }