ref(dependency): update react native device info dependency

pull/13793/head
Calin-Teodor 2 years ago committed by Calinteodor
parent 746be98bfc
commit 1def65eb90
  1. 14
      package-lock.json
  2. 2
      package.json
  3. 9
      react/features/analytics/handlers/amplitude/fixDeviceID.native.ts

14
package-lock.json generated

@ -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",

@ -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",

@ -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);
}

Loading…
Cancel
Save