diff --git a/apps/rebreak-native/lib/deviceId.ts b/apps/rebreak-native/lib/deviceId.ts index 4be7e24..fbeb576 100644 --- a/apps/rebreak-native/lib/deviceId.ts +++ b/apps/rebreak-native/lib/deviceId.ts @@ -1,6 +1,7 @@ import { Platform } from 'react-native'; import AsyncStorage from '@react-native-async-storage/async-storage'; import * as Application from 'expo-application'; +import * as Device from 'expo-device'; import Constants from 'expo-constants'; const STORAGE_KEY = 'rebreak_device_id'; @@ -63,17 +64,22 @@ export async function getDeviceInfo(): Promise { const deviceId = await getDeviceId(); const platform = getPlatformName(); + // expo-device returnt zuverlässige Hardware-Infos auf realen Devices. + // Constants ist Fallback für Simulator/Web (Device-APIs sind dort null). const name = + Device.deviceName || (Constants as any).deviceName || - Constants.platform?.ios?.model || + Device.modelName || platform; const model = + Device.modelName || + Device.modelId || Constants.platform?.ios?.model || - Constants.platform?.android?.versionCode?.toString() || platform; const osVersion = + Device.osVersion || Constants.platform?.ios?.systemVersion?.toString() || (Platform.Version as string | number)?.toString() || ''; diff --git a/apps/rebreak-native/package.json b/apps/rebreak-native/package.json index 2d67df9..4e02045 100644 --- a/apps/rebreak-native/package.json +++ b/apps/rebreak-native/package.json @@ -32,6 +32,7 @@ "expo-clipboard": "^8.0.8", "expo-constants": "~18.0.13", "expo-dev-client": "~6.0.21", + "expo-device": "^55.0.17", "expo-file-system": "~19.0.22", "expo-font": "~14.0.11", "expo-haptics": "^15.0.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79c1b0a..87b6a51 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -180,6 +180,9 @@ importers: expo-dev-client: specifier: ~6.0.21 version: 6.0.21(expo@54.0.34) + expo-device: + specifier: ^55.0.17 + version: 55.0.17(expo@54.0.34) expo-file-system: specifier: ~19.0.22 version: 19.0.22(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.2.14)(react@19.1.0)) @@ -5526,6 +5529,11 @@ packages: peerDependencies: expo: '*' + expo-device@55.0.17: + resolution: {integrity: sha512-ZcMrSeD0zWooosm5Bet5qluxUrhw+NPgcMmN6ySVF7cm4K8Bvh4KPogJePbI1qfhFAiJWcWeV9e/2uewb9ktfw==} + peerDependencies: + expo: '*' + expo-file-system@19.0.22: resolution: {integrity: sha512-l9pgahSc7sJD0bP9vBNeXvZjy8QKDpVHVxWmei/ESQOrzmoj5BidziqLVsyZdxsi+PfdbTtttLTAmddH/JafYA==} peerDependencies: @@ -8778,6 +8786,10 @@ packages: engines: {node: '>=14.17'} hasBin: true + ua-parser-js@0.7.41: + resolution: {integrity: sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==} + hasBin: true + ufo@1.6.1: resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} @@ -15519,6 +15531,11 @@ snapshots: expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0)(typescript@5.8.3) expo-dev-menu-interface: 2.0.0(expo@54.0.34) + expo-device@55.0.17(expo@54.0.34): + dependencies: + expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0)(typescript@5.8.3) + ua-parser-js: 0.7.41 + expo-file-system@19.0.22(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.2.14)(react@19.1.0)): dependencies: expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.2.14)(react@19.1.0))(react@19.1.0)(typescript@5.8.3) @@ -19505,6 +19522,8 @@ snapshots: typescript@5.9.3: {} + ua-parser-js@0.7.41: {} + ufo@1.6.1: {} ufo@1.6.4: {}