Bluesky app fork with some witchin' additions 馃挮
witchsky.app
bluesky
fork
client
1import {Platform} from 'react-native'
2import {nativeBuildVersion} from 'expo-application'
3
4import {BUNDLE_IDENTIFIER, IS_TESTFLIGHT, RELEASE_VERSION} from '#/env/common'
5
6export * from '#/env/common'
7
8// for some reason Platform.OS === 'ios' AND Platform.Version is undefined in our CI unit tests -sfn
9const iOSMajorVersion =
10 Platform.OS === 'ios' && typeof Platform.Version === 'string'
11 ? parseInt(Platform.Version.split('.')[0], 10)
12 : 0
13
14/**
15 * The semver version of the app, specified in our `package.json`.file. On
16 * iOs/Android, the native build version is appended to the semver version, so
17 * that it can be used to identify a specific build.
18 */
19export const APP_VERSION = `${RELEASE_VERSION}.${nativeBuildVersion}`
20
21/**
22 * The short commit hash and environment of the current bundle.
23 */
24export const APP_METADATA = `${BUNDLE_IDENTIFIER.slice(0, 7)} (${
25 __DEV__ ? 'dev' : IS_TESTFLIGHT ? 'tf' : 'prod'
26})`
27
28/**
29 * Platform detection
30 */
31export const IS_IOS: boolean = Platform.OS === 'ios'
32export const IS_ANDROID: boolean = Platform.OS === 'android'
33export const IS_NATIVE: boolean = true
34export const IS_WEB: boolean = false
35
36/**
37 * Web-specific platform detection
38 */
39export const IS_WEB_TOUCH_DEVICE: boolean = true
40export const IS_WEB_MOBILE: boolean = false
41export const IS_WEB_MOBILE_IOS: boolean = false
42export const IS_WEB_MOBILE_ANDROID: boolean = false
43export const IS_WEB_SAFARI: boolean = false
44export const IS_WEB_FIREFOX: boolean = false
45
46/**
47 * Misc
48 */
49export const IS_HIGH_DPI: boolean = true
50// ideally we'd use isLiquidGlassAvailable() from expo-glass-effect but checking iOS version is good enough for now
51export const IS_LIQUID_GLASS: boolean = iOSMajorVersion >= 26
52// So we can avoid attempting on-device translation when we know it's unsupported.
53export const HAS_ON_DEVICE_TRANSLATION: boolean =
54 (IS_IOS && iOSMajorVersion >= 18) || IS_ANDROID