diff --git a/js/app/components/get-apps.tsx b/js/app/components/get-apps.tsx index 79dadd7c..313bbd60 100644 --- a/js/app/components/get-apps.tsx +++ b/js/app/components/get-apps.tsx @@ -1,3 +1,4 @@ +import { STORE_URLS } from "constants/store-urls"; import { Image } from "expo-image"; import { Linking, TouchableOpacity, View } from "react-native"; @@ -8,25 +9,13 @@ const HEIGHT = 200 / RATIO; export default function GetApps() { return ( - - Linking.openURL( - "https://apps.apple.com/us/app/streamplace/id6535653195", - ) - } - > + Linking.openURL(STORE_URLS.ios)}> - - Linking.openURL( - "https://play.google.com/store/apps/details?id=tv.aquareum", - ) - } - > + Linking.openURL(STORE_URLS.android)}> { try { @@ -51,9 +30,13 @@ export function MobileAppBanner() { }); const insets = useSafeAreaInsets(); - const mobilePlatform = getMobilePlatform(); + const platform = usePlatform(); - if (dismissed || !mobilePlatform) return null; + if ( + dismissed || + !((platform.isWebIOS && !platform.isMobileSafari) || platform.isWebAndroid) + ) + return null; const dismiss = () => { try { @@ -62,6 +45,8 @@ export function MobileAppBanner() { setDismissed(true); }; + const mobilePlatform = platform.isWebIOS ? "ios" : "android"; + return ( number; }; diff --git a/js/app/hooks/usePlatform.tsx b/js/app/hooks/usePlatform.tsx index d92f4366..44b39e6c 100644 --- a/js/app/hooks/usePlatform.tsx +++ b/js/app/hooks/usePlatform.tsx @@ -25,10 +25,13 @@ export default function usePlatform(): IsPlatform { isIOS: false, isAndroid: false, isWeb: true, + isWebAndroid: /Android/.test(ua), + isWebIOS: /iPhone|iPad|iPod/.test(ua), isElectron: electron, isBrowser: !electron, isSafari: ua.browser.name.includes("Safari"), isFirefox: ua.browser.name === "Firefox", isChrome: ua.browser.name === "Chrome", + isMobileSafari: /Safari/.test(ua) && !/CriOS|FxiOS|EdgiOS/.test(ua), }; }