diff --git a/package-lock.json b/package-lock.json index 3b908332e3..4ba71a1423 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,7 @@ "react-native-calendar-events": "2.2.0", "react-native-callstats": "3.73.22", "react-native-default-preference": "1.4.4", - "react-native-device-info": "8.4.8", + "react-native-device-info": "10.9.0", "react-native-dialog": "9.3.0", "react-native-gesture-handler": "2.9.0", "react-native-get-random-values": "1.9.0", @@ -15806,9 +15806,9 @@ } }, "node_modules/react-native-device-info": { - "version": "8.4.8", - "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-8.4.8.tgz", - "integrity": "sha512-92676ZWHZHsPM/EW1ulgb2MuVfjYfMWRTWMbLcrCsipkcMaZ9Traz5mpsnCS7KZpsOksnvUinzDIjsct2XGc6Q==", + "version": "10.9.0", + "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-10.9.0.tgz", + "integrity": "sha512-HqujZoNSkPGYZVs8ZsAwPkdY5UQt2jW0eg/wtW/kKbcAOp0KjUesgG7e1UISY4Z7Bx6LjZeKs0cqDzQI8AlOmw==", "peerDependencies": { "react-native": "*" } @@ -32126,9 +32126,9 @@ "integrity": "sha512-h0vtgiSKws3UmMRJykXAVM4ne1SgfoocUcoBD19ewRpQd6wqurE0HJRQGrSxcHK5LdKE7QPSIB1VX3YGIVS8Jg==" }, "react-native-device-info": { - "version": "8.4.8", - "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-8.4.8.tgz", - "integrity": "sha512-92676ZWHZHsPM/EW1ulgb2MuVfjYfMWRTWMbLcrCsipkcMaZ9Traz5mpsnCS7KZpsOksnvUinzDIjsct2XGc6Q==" + "version": "10.9.0", + "resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-10.9.0.tgz", + "integrity": "sha512-HqujZoNSkPGYZVs8ZsAwPkdY5UQt2jW0eg/wtW/kKbcAOp0KjUesgG7e1UISY4Z7Bx6LjZeKs0cqDzQI8AlOmw==" }, "react-native-dialog": { "version": "9.3.0", diff --git a/package.json b/package.json index 01a3183ef4..f3b1ba0b25 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "react-native-calendar-events": "2.2.0", "react-native-callstats": "3.73.22", "react-native-default-preference": "1.4.4", - "react-native-device-info": "8.4.8", + "react-native-device-info": "10.9.0", "react-native-dialog": "9.3.0", "react-native-gesture-handler": "2.9.0", "react-native-get-random-values": "1.9.0", diff --git a/react/features/analytics/handlers/amplitude/fixDeviceID.native.ts b/react/features/analytics/handlers/amplitude/fixDeviceID.native.ts index f5e8932316..432a697444 100644 --- a/react/features/analytics/handlers/amplitude/fixDeviceID.native.ts +++ b/react/features/analytics/handlers/amplitude/fixDeviceID.native.ts @@ -2,6 +2,9 @@ import { Amplitude } from '@amplitude/react-native'; import DefaultPreference from 'react-native-default-preference'; import DeviceInfo from 'react-native-device-info'; +import logger from '../../logger'; + + /** * Custom logic for setting the correct device id. * @@ -18,6 +21,12 @@ export async function fixDeviceID(amplitude: Amplitude) { } else { const uid = DeviceInfo.getUniqueId(); + if (!uid) { + logger.warn('Device ID is not set!'); + + return; + } + amplitude.setDeviceId(uid); DefaultPreference.set('amplitudeDeviceId', uid); }