Bro,
just try this on any NON JAILBROKEN iOS device.
create an API that returns backs an NSString having the serial number or the manufacturer id, or IMEI, or UDID. Something that will always remain the same, and uniquely identifies the device, even the mac address would do, or a combination of various fields also will work. Research on this a bit more, and you will find there is ABSOLUTELY no way to do it. , Uber, Twitter, HP, VMWare all have tried, only Uber has been successful, and at a massive consequence
Apple protects its users from 3rd party data analytics, with each version of iOS, the restrictions just become more and more hardened.
I have been given this task for a month now, to investigate if it is even possible. So far, there is absolutely no way to do it. If that's not secure, I do not know what is.
Whereas for android, give any college student 10 bucks and the same can be accomplished on Android easily.
Apple threatened to oust Uber from App Store for ‘fingerprinting’ iPhones
I myself am curious how Uber managed to do it, perhaps by some server side magic.
I am not saying what Apple is doing is absolutely right, for all kinds of demographic. I would never buy an iPhone just because of this many restrictions, but apple does provide a "service" along with the iPhone. Whether you like it or not, depends on you.