Skip to content

Commit fff7405

Browse files
authored
Merge pull request #67 from AmoebeLabs/fix-android-app
Fix Android Companion App detection
2 parents 438fe7e + 0f0e621 commit fff7405

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Diff for: flex-horseshoe-card.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
} from "https://unpkg.com/[email protected]/lit-element.js?module";
2727

2828
console.info(
29-
`%c FLEX-HORSESHOE-CARD \n%c Version 1.1 `,
29+
`%c FLEX-HORSESHOE-CARD \n%c Version 1.2 `,
3030
'color: yellow; font-weight: bold; background: black',
3131
'color: white; font-weight: bold; background: dimgray',
3232
);
@@ -98,10 +98,13 @@ import {
9898
// After iOS 13 you should detect iOS devices like this, since iPad will not be detected as iOS devices
9999
// by old ways (due to new "desktop" options, enabled by default)
100100

101-
this.isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);
102-
this.iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) ||
103-
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
104-
!window.MSStream;
101+
this.isAndroid = !!navigator.userAgent.match(/Android/);
102+
if (!this.isAndroid) {
103+
this.isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/);
104+
this.iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) ||
105+
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&
106+
!window.MSStream;
107+
}
105108
}
106109

107110
/*******************************************************************************

0 commit comments

Comments
 (0)