0

In my React Native app, I have to pass a unique ID to an API endpoint, and I've been told that it has to be a GUID. What I want to know is:

1) Does the getUniqueId() method in react-native-device-info give a GUID?

2) I've seen another module react-native-create-guid. It says that it "creates" a GUID. I thought that the device automatically has a GUID associated with it?

gkeenley
  • 6,088
  • 8
  • 54
  • 129

1 Answers1

3

GUID/UUID is not a device ID. It is a standard of a unique identifier that is statistically unlikely to be duplicated. GUIDs are used virtually everywhere, and not only when you need to identify a device. react-native-create-guid is a general-purpose library unrelated to the device identification domain.

As for the device ID, can be a GUID/UUID, or it can be something else – any random string. It is up to the device manufacturer and standards imposed by the platform. If I remember correctly, on Android the Device ID is not guaranteed to be a GUID at all. On iOS, on the other hand, the device ID is indeed a UUID. The identifier is called "IDFV" and it is generated in a peculiar way – see Apple's documentation for more details.

You need to talk with your backend engineer to clarify the requirements.

ivanmoskalev
  • 2,004
  • 1
  • 16
  • 25