Skip to content

Commit

Permalink
Fix Android Companion App detection
Browse files Browse the repository at this point in the history
See the following issues:
- Issue #53
- Issue #48
  • Loading branch information
AmoebeLabs committed May 2, 2023
1 parent 438fe7e commit 0f0e621
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions flex-horseshoe-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "https://unpkg.com/lit-element@2.0.1/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',
);
Expand Down Expand Up @@ -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;
}
}

/*******************************************************************************
Expand Down

0 comments on commit 0f0e621

Please sign in to comment.