I’m developing an iOS app, but i need to identify the user who made the request to the web server.
I read on the internet that i cannot retrieve user’s phone number, is there anything else that i can use to identify user?
I need something “legally-valid” (I mean that if the user do something illegal with my app, I should be able to track it down)
I cannot just “let user type its phone number” because i need that it’s really true. I cannot risk that user type the number of someone else
You can get the phone number; you just have to ask the user for it.
In the past, people have used the device UDID for this sort of thing. The UDID is deprecated now, and new devices may not even have one. You can search on UDID to find out what people are using in place of the UDID — in particular, look for the OpenUDID and SecureUDID projects. In some cases the device’s wifi MAC address can be used, but that brings with it some of the same privacy concerns as the UDID.
You can also just generate and store a globally unique identifier. Search for “GUID” to learn how to do this. With a GUID, you can be virtually certain that the identifier is unique.
It’s not clear what you mean by “legally valid”. Is that “valid” with respect to privacy laws, cryptography laws, communications regulations, or something else? And in what country?