How to get serial number of iPhone programmatically?

I was searching to get ios device serial number programmatically for App Store app.

Replies

Apple has deliberately disallowed apps from accessing any persistent device identifier such as the UDID or serial number, for privacy reasons. They don’t want apps tracking individual users. So there is no such API.

When Apple first stopped allowing apps to get any identifier for the device the best alternative was to write something to the keychain. The keychain survives deletion and reinstallation of the app. It does not survive restoring from backup or a complete wipe of the device.

>I was searching to get ios device serial number programmatically for App Store app.


As jp notes, that info is private to the user. Perhaps ifyou discussed exactly 'why' you need it, someone could offer specific alternatives for your example.