iOS device properties and hardware features
Understand the iOS device properties and hardware features you can access from a script.
Read time 2 minutesLast updated 13 days ago
You can access iOS device properties and hardware features, such as vibration and display cutouts, from a script. Most features of the iOS devices are exposed through the and classes. For cross-platform projects, Unity defines for conditional compilation of iOS-specific C# code.
InputHandheldUNITY_IPHONEDevice properties
You can access the following device-specific properties:
SystemInfo.deviceUniqueIdentifierSystemInfo.deviceNameSystemInfo.deviceModelSystemInfo.operatingSystem
Device generation
Different device generations have varied performance and support different functionalities. Use the property to query the device’s generation.
iOS.DeviceGenerationTrigger a vibration
To trigger a vibration, call . Devices without vibration hardware ignore this call.
Handheld.VibrateActivity indicator
Mobile operating systems have built-in activity indicators you can use during slow operations. For examples, refer to .
Handheld.StartActivityIndicatorDisplay cutout
On some displays, certain areas of the screen might be obscured or non-functional because of other hardware occupying that space. Use to return a list of bounding boxes surrounding each cutout.
Screen.cutoutsiOS devices don't provide a native API to get the display cutout information, so the cutouts are hardcoded in the Xcode project for each available iOS device. You can modify existing data or add additional devices in the Unity Xcode project function, which is in the file.
ReportSafeAreaChangeForViewUnityView.mmAnti-piracy check
A common way of hacking an application is by removing the App Store DRM protection and then redistributing it for free. Use Unity’s anti-piracy check to find out if your application was altered after it was submitted to the App Store.
Check if your application is genuine (not hacked) with the property. If the property returns , you can warn users they are using a hacked app, or you can disable certain functions.
Application.genuinefalse