Skip to content

Device Info

Stanislav Osipov edited this page Jun 19, 2020 · 4 revisions

Use a ISN_UIDevice to get information about the device such as assigned name, device model, and operating-system name and version.

This is how you may print basic device info:

using SA.iOS.UIKit;
...
Debug.Log("Name:" + ISN_UIDevice.CurrentDevice.Name);
Debug.Log("SystemName:" + ISN_UIDevice.CurrentDevice.SystemName);
Debug.Log("SystemVersion:" + ISN_UIDevice.CurrentDevice.SystemVersion);
Debug.Log("Model:" + ISN_UIDevice.CurrentDevice.Model);
Debug.Log("LocalizedModel:" + ISN_UIDevice.CurrentDevice.LocalizedModel);
Debug.Log("MajorIOSVersion:" + ISN_UIDevice.CurrentDevice.MajorIOSVersion);

User Interface Idiom

For universal applications, you can use UserInterfaceIdiom property

To tailor the behavior of your application for a specific type of device. For example, iPhone and iPad devices have different screen sizes, so you might want to create different views and controls based on the type of the current device.

using SA.iOS.UIKit;
...
Debug.Log("UserInterfaceIdiom:" + ISN_UIDevice.CurrentDevice.UserInterfaceIdiom);

Identifier For Vendor

The identifier is represented as an alphanumeric string that uniquely identifies a device to the app’s vendor. The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that comes from different vendors, and for apps on different devices regardless of vendor. Normally, the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as enterprise apps and apps still in development), then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format.

using SA.iOS.UIKit;
...
Debug.Log("IdentifierForVendor:" + ISN_UIDevice.CurrentDevice.IdentifierForVendor);

Check iOS Version

The ISN_UIDevice object also contains current SystemVersion and MajorIOSVersion

For example if you would like to check if current iOS version is less than 13 here is the code sample how you can do that:

var majorOSVersion = ISN_UIDevice.CurrentDevice.MajorIOSVersion;
if (majorOSVersion < 13)
{
    // Do Something.
}

About

Foundation

AV Foundation

App Tracking Transparency

Game Kit

Store Kit

UI Kit

Social

Replay Kit

Contacts

AVKit

Photos

App Delegate

User Notifications

MediaPlayer

Core Location

AdSupport

EventKit

CloudKit

Authentication Services

XCode

Knowledge Base

Clone this wiki locally