Platforms to show: All Mac Windows Linux Cross-Platform

Back to UIDeviceMBS class.

UIDeviceMBS.BatteryLevel as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The battery charge level for the device.

Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). Before accessing this property, ensure that battery monitoring is enabled.

If battery monitoring is not enabled, battery state is BatteryStateUnknown and the value of this property is –1.0.
(Read only property)

UIDeviceMBS.BatteryMonitoringEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
A Boolean value that indicates whether battery monitoring is enabled.

Enable battery monitoring if your app needs to be notified of changes to the battery state, or if you want to check the battery charge level.

The default value of this property is false, which:

  • Disables the posting of battery-related notifications
  • Disables the ability to read battery charge level and battery state
(Read and Write property)

UIDeviceMBS.BatteryState as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The battery state for the device.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

Var s As String
Select Case currentDevice.BatteryState
Case UIDeviceMBS.BatteryStateCharging
s = "Charging"
Case UIDeviceMBS.BatteryStateUnplugged
s = "Unplugged"
Case UIDeviceMBS.BatteryStateFull
s = "Full"
Case UIDeviceMBS.BatteryStateUnknown
s = "Unknown"
End Select

MessageBox s

The value for batteryState is one of the constants.

If battery monitoring is not enabled, the value of this property is BatteryStateUnknown.
(Read only property)

UIDeviceMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The internal object reference.

(Read and Write property)

UIDeviceMBS.identifierForVendor as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
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 come 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 wasn’t 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.

In IOS 7 or later, all components of the bundle except for the last component are used to generate the vendor ID. If the bundle ID only has a single component, then the entire bundle ID is used.

The following table shows a collection of bundle IDs and which portions of the bundle ID the system uses to calculate the vendor ID.

For example, com.example.app1 and com.example.app2 would appear to have the same vendor ID.
If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.
(Read only property)

UIDeviceMBS.isGeneratingDeviceOrientationNotifications as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
A Boolean value that indicates whether the device generates orientation notifications.

If the value of this property is YES, the shared UIDevice object posts a UIDeviceOrientationDidChangeNotification notification when the device changes orientation (and raises event). If the value is false, it generates no orientation notifications. Device orientation notifications can only be generated between calls to the beginGeneratingDeviceOrientationNotifications and endGeneratingDeviceOrientationNotifications methods.
(Read only property)

UIDeviceMBS.isMultitaskingSupported as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
A Boolean value that indicates whether the current device supports multitasking.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

MessageBox currentDevice.isMultitaskingSupported.ToString

(Read only property)

UIDeviceMBS.LocalizedModel as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The model of the device as a localized string.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

MessageBox currentDevice.Model + EndOfLine+ currentDevice.LocalizedModel

The value of this property is a string that contains a localized version of the string returned from model.
(Read only property)

UIDeviceMBS.Model as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The model of the device.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

MessageBox currentDevice.Model + EndOfLine+ currentDevice.LocalizedModel

Possible examples of model strings are ”iPhone” and ”iPod touch”.
(Read only property)

UIDeviceMBS.Name as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The name of the device.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

MessageBox currentDevice.Name + EndOfLine+ currentDevice.Model

The default value of this property varies according to the device’s operating system version number.

Real name until iOS 15, otherwise just "iPhone"

In iOS, the user-assigned device name is available in the Settings app under General > About > Name. To access the user-assigned device name through this property in iOS 16 and later, your app must meet certain criteria and be assigned an entitlement. For information, see com.apple.developer.device-information.user-assigned-device-name.
(Read only property)

UIDeviceMBS.Orientation as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The physical orientation of the device.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

Var s As String
Select Case currentDevice.Orientation
Case UIDeviceMBS.DeviceOrientationFaceDown
s = "FaceDown"
Case UIDeviceMBS.DeviceOrientationFaceUp
s = "FaceUp"
Case UIDeviceMBS.DeviceOrientationLandscapeLeft
s = "LandscapeLeft"
Case UIDeviceMBS.DeviceOrientationLandscapeRight
s = "LandscapeRight"
Case UIDeviceMBS.DeviceOrientationPortrait
s = "Portrait"
Case UIDeviceMBS.DeviceOrientationPortraitUpsideDown
s = "PortraitUpsideDown"
Case UIDeviceMBS.DeviceOrientationUnknown
s = "Unknown"
End Select

MessageBox s

The value of the property is a constant that indicates the current orientation of the device. This value represents the physical orientation of the device and may be different from the current orientation of your application’s user interface. See DeviceOrientation constants for descriptions of the possible values.
The value of this property always returns 0 unless orientation notifications have been enabled by calling beginGeneratingDeviceOrientationNotifications.
(Read only property)

UIDeviceMBS.ProximityMonitoringEnabled as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
A Boolean value that indicates whether proximity monitoring is enabled.

Enable proximity monitoring only when your application needs to be notified of changes to the proximity state. Otherwise, disable proximity monitoring. The default value is false.

Not all iOS devices have proximity sensors. To determine if proximity monitoring is available, attempt to enable it. If the value of the proximityMonitoringEnabled property remains NO, proximity monitoring isn’t available.
(Read and Write property)

UIDeviceMBS.ProximityState as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
A Boolean value that indicates whether the proximity sensor is close to the user.

(Read only property)

UIDeviceMBS.SystemName as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The name of the operating system running on the device.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice
MessageBox currentDevice.SystemName

(Read only property)

UIDeviceMBS.SystemVersion as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The current version of the operating system.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

MessageBox currentDevice.SystemName + EndOfLine+ currentDevice.SystemVersion

(Read only property)

UIDeviceMBS.UserInterfaceIdiom as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
The style of interface to use on the current device.

For universal applications, you can use this 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.
(Read only property)

The items on this page are in the following plugins: MBS iOS Plugin.


The biggest plugin in space...