mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-02 02:19:43 +00:00
Update
This commit is contained in:
1 parent
6ff5bc62f2
commit
adab288a3a
204 files changed
+11334
-14295
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { Platform, Dimensions } from 'react-native';
|
||||
import Constants from 'expo-constants';
|
||||
import type { DeviceInfo } from '../types';
|
||||
|
||||
export function getDeviceInfo(): DeviceInfo {
|
||||
const { width, height } = Dimensions.get('window');
|
||||
|
||||
return {
|
||||
platform: Platform.OS as 'ios' | 'android' | 'web',
|
||||
osVersion: Platform.Version?.toString() ?? 'unknown',
|
||||
appVersion: Constants.expoConfig?.version ?? '1.0.0',
|
||||
buildNumber: Platform.select({
|
||||
ios: Constants.expoConfig?.ios?.buildNumber,
|
||||
android: Constants.expoConfig?.android?.versionCode?.toString(),
|
||||
default: undefined,
|
||||
}),
|
||||
deviceModel: Platform.select({
|
||||
ios: Constants.platform?.ios?.model,
|
||||
android: Constants.platform?.android?.model,
|
||||
default: undefined,
|
||||
}),
|
||||
screenWidth: width,
|
||||
screenHeight: height,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user