Вопрос

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.

Это было полезно?

Решение

Save the UUID into the keychain.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top