Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
723 views
in Technique[技术] by (71.8m points)

react-native 如何可靠的获取设备唯一ID?

在尝试使用 react-native-device-info 后,发现部分设备ID会变化

寻找文档发现:

https://developer.android.com...

注意:对于在将设备更新到Android 8.0(API级别26)或更高版本之前安装的应用程序,ANDROID_ID如果在卸载OTA之后再重新安装该应用程序,

请问有什么可靠的方式获取不会变化的唯一ID呢?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

真要唯一就用 IMEI,不过这个需要额外的权限,市场统计来看至少 35% 的用户会选择关闭这个权限。


P.S. 现在欧美对于隐私这块愈趋严格,像 iOS 这块就非常严格,你只能用 IDFA/UDID 这种会变化的追踪标识符,而且用户可以在设置中自行做改变。Android 因为历史遗留问题,还有一些可以获取的设备唯一的追踪标识符的方式(比如 IMEI),随着系统升级也会越来越严格。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...