Skip to content

Commit

Permalink
Merge pull request #67 from AmoebeLabs/fix-android-app
Browse files Browse the repository at this point in the history
Fix Android Companion App detection
  • Loading branch information
AmoebeLabs authored May 2, 2023
2 parents 438fe7e + 0f0e621 commit fff7405
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 fff7405

Please sign in to comment.