Reputation: 10759
Here is my situation and problem. I have an app that is used by a commercial company. They give their workers a phone with our app installed on it, the workers might swap phones (i.e. first come first serve; grab what is available).
The company needs a way to identify each phone in case it stolen and to use for inventory, but from our app. Our solution gives them a way to remote wipe the app should the phone be lost or stolen. Since we cant use the UUID, per Apple, we not sure how to identify the phone for wiping. I know there is a temp way to sue a temp UUID, but that temp UUID has the ability to change or be reset by Apple or another app on the phone. So if that UUID get change out from under us we can't wipe it or identify it as the new change UUID would be passed up.
The other issue with us generating a unique ID of our own when the app is installed is that if some uninstalls our app and reinstalls, for whatever reason, it will create a new unique ID on the backend. Now we have to ID's on the backend for the same phone, so inventory will show one extra phone.
We can't trust the companies to always be sure to wipe out the old ID should they reinstall the app.
Any suggestions?
Upvotes: 2
Views: 1704
Reputation: 3850
Following code will help you to get unique alphanumeric value which will be same for apps that come from the same vendor running on the same device
Which means if you 5 Apps. published , all of them will return you a same unique value on a particular device.
[[[UIDevice currentDevice] identifierForVendor] UUIDString]
Please find the Reference at Developer Library
Other solution would be to use OpenUDID.
Third Solution is as below:
When App. Launches for the first time, create your own unique id from "CFUUIDCreate"
Save this with NSUserDefault in Cloud.
So, now if the app is uninstalled it will still have same id for that user when fetched from the Cloud.
In case phone is reset, you will still get the same ID unless and until cloud account is changed.
Upvotes: 0
Reputation: 2916
OS X Server
has a function to manage remote devices, it's very useful for enterprise. such as manage VPN settings, wifi settings,distribute apps, remote wipe if stolen. You should research MDM.
if your iPhone is stolen you can do nothing in your app. Upvotes: 4
Reputation: 62686
Best idea I know about is to include AdSupport and do this:
NSString *uuid = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
NSUserDefaults can persist this across app updates. Not sure across uninstalls. For that, you might need user identity and storage off the device.
Upvotes: 1