-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from AmoebeLabs/fix-android-app
Fix Android Companion App detection
- Loading branch information
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ import { | |
} from "https://unpkg.com/[email protected]/lit-element.js?module"; | ||
|
||
console.info( | ||
`%c FLEX-HORSESHOE-CARD \n%c Version 1.1 `, | ||
`%c FLEX-HORSESHOE-CARD \n%c Version 1.2 `, | ||
'color: yellow; font-weight: bold; background: black', | ||
'color: white; font-weight: bold; background: dimgray', | ||
); | ||
|
@@ -98,10 +98,13 @@ import { | |
// After iOS 13 you should detect iOS devices like this, since iPad will not be detected as iOS devices | ||
// by old ways (due to new "desktop" options, enabled by default) | ||
|
||
this.isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); | ||
this.iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) || | ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && | ||
!window.MSStream; | ||
this.isAndroid = !!navigator.userAgent.match(/Android/); | ||
if (!this.isAndroid) { | ||
this.isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); | ||
this.iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) || | ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && | ||
!window.MSStream; | ||
} | ||
} | ||
|
||
/******************************************************************************* | ||
|