Persistent device identifier even after app gets uninstalled

随声附和 提交于 2019-12-20 03:56:11

问题


In my iPhone/iPad app's use case, there is a voting system and one device can send its vote once to the server. Therefore my server needs to identify user's device. I don't want the user to register an account because that makes the app complicate. However, I couldn't find a solution that works.

  • UDID is deprecated
  • I presume getting MAC address will get your app rejected by the app review process
  • I tried creating my own UUID using [[NSUUID UUID] UUIDString] and then storing it using NSUserDefaults, but the settings disappear if the user uninstalls the app
  • identifierForVendor is also reset when the user uninstalls the app
  • I considered advertisingIdentifier but because I'm not using it for advertisement, I presume it will also be rejected by the app review process

I'm not asking for a bulletproof solution in every situation. Just a solution that works even if the user uninstalls the app. Because I can generate my own UUID, I guess my question boils down to: How I can save data for the app that survives app uninstallation?

However if any of you have other approach, please feel free to inform me. Thanks.


回答1:


Save the UUID into the keychain.



来源:https://stackoverflow.com/questions/17130477/persistent-device-identifier-even-after-app-gets-uninstalled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!