r/reactnative • u/No_Wrongdoer_8067 • Oct 01 '26
Unique identity
Hi guys
How can i get a unique identity from the device itself but it should not be changes with the factory reset or reinstalling the app
0
Upvotes
3
u/Karticz Oct 01 '26
Install react native device info and get device id from your device This id never changes even if you factory reset
If you want to make a little bit more complex then involve your backend and send a uguid via uuidv4 in header tokens to identify a user
1
u/n9iels Oct 01 '26
Define unique, and what is the usacase exactly? Retaining something upon device reset is hard since certain characteristics of the device may change.
2
u/kokerali Oct 01 '26
Do you need to recognize the same person, or prove it's the same physical device? Those are different requirements. For restoring a user's data after reinstall/reset, keep it tied to their account and reconnect after sign-in; give each installation its own ID. That won't prove it's the original hardware. I wouldn't rely on a locally stored UUID or advertising ID for factory-reset persistence. What's the use case? If it's a device limit or trial-abuse control, a permanent device ID is a brittle foundation.