-
Notifications
You must be signed in to change notification settings - Fork 1
Device Info
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);
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);
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);
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.
}
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Getting Started
- Authentication
- Game Center UI
- Leaderboards
- Default Leaderboard
- Achievements
- Saving A Game
- Access Point
- iTunes Connect Setup
- StoreKit Initialization
- Purchase flow
- Receipt Validation
- Store Review Controller
- Storefront API
- Subscription Offers