If by device name, you meant UDID (Unique Device Identifier) of the iOS device, its against a proposed US Internet privacy law to access it. If your app tries to get the UDID, it might get rejected from appstore. If you want to track the devices on which your app is running, you can use a few virtual UDID generators like here:SecureUDID
If you just wanted some unique identifier to identify some device on a network, you might try reading the mac address of the network interface on iDevice. But doing that might/might-not run foul of Apple's guidelines.
Either way, Apple seriously frowns on apps that try to identify user devices (unless they are virtual UDIDs like in the link). So be very sure of what your aim is.
One disclaimer though..if your app is not targeted for sale in USA, accessing UDID is in grey (read unclear) area of Apple's guidelines.