Skip to content

Commit 60f49ac

Browse files
committed
fix bootstrap issue on ipad : UA detection
1 parent 9ce2301 commit 60f49ac

File tree

1 file changed

+5
-3
lines changed
  • TeadsDemoApp/Controllers/webViewController/webViewHelper/Ressources

1 file changed

+5
-3
lines changed

TeadsDemoApp/Controllers/webViewController/webViewHelper/Ressources/bootstrap.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@
161161
**************************/
162162

163163
var getPlatformType = function() {
164+
const hasTouchPoints = !!(navigator.maxTouchPoints && navigator.maxTouchPoints > 0)
165+
const userAgent = navigator.userAgent.toLowerCase()
164166
return tryOrLog(function() {
165-
if (/android/i.test(navigator.userAgent.toLowerCase())) {
167+
if (/android/i.test(userAgent)) {
166168
return ANDROID_OS;
167-
} else if (/iphone|ipad|ipod/i.test(navigator.userAgent.toLowerCase())) {
169+
} else if (/iphone|ipad|ipod/i.test(userAgent) || (/mac\s+os/i.test(userAgent) && hasTouchPoints)) {
168170
return IOS_OS;
169171
} else return UNKNOWN_OS;
170172
}, 'getPlatformType')
@@ -299,4 +301,4 @@
299301
}
300302
// START !
301303
sendJsLibReady();
302-
})();
304+
})();

0 commit comments

Comments
 (0)