DeviceSoftwareRules

@objc
public class DeviceSoftwareRules : NSObject, InitializationStateProvider

Configures the minimum OS version and any restricted devices required by your application.

The following is example of how to configure iOS 12 as the minimum operating system and exclude Apple Silicon Macs:

    let deviceSoftwareRules = try! DeviceSoftwareRules.init(minimumOSVersion: "12.0",
                                                            blacklistedModels: [DeviceSoftwareRules.iOSDeviceModelType.AppleSiliconMac],
                                                            enableDeviceSoftwareCheck: true)
  • Designated initializer

    Declaration

    Swift

    public convenience init(minimumOSVersion: String, blacklistedModels: [iOSDeviceModelType], enableDeviceSoftwareCheck: Bool) throws
  • This function configures the minimum iOS operating system (OS) version. Devices with iOS versions lower than this will be flagged as a risk.

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    public func setMinimumOSVersion(_ version: String) throws -> DeviceSoftwareRules

    Parameters

    version

    A version expressed in the dot notation format (x.x.x)

  • The minimum iOS operating system (OS) version. Devices with iOS versions higher than this will be considered safe

    Declaration

    Swift

    public var minimumOSVersion: Result<String, Error> { get }
  • This function configures the restricted device list. These devices will be flagged as a risk.

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    public func setRestrictedDeviceModels(_ models: [iOSDeviceModelType]) throws

    Parameters

    models

    An array of restricted device models (options: iOSDeviceModelType/AppleSiliconMac, iOSDeviceModelType/iPad, iOSDeviceModelType/iPhone)

  • The array of restricted models (e.g [.AppleSiliconMac])

    Declaration

    Swift

    public var getRestrictedDeviceModels: Result<[iOSDeviceModelType], Error> { get }
  • Enable the checks for software (OS, device model)

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    public func enableCheck() throws
  • Disable the checks for software (OS, device model)

    Throws

    invalidInitializationState indicating that lib is incorrect state to use this API

    Declaration

    Swift

    public func disableCheck() throws
  • Get the checks for software (OS, device model)

    Declaration

    Swift

    public func isDeviceSoftwareCheckEnabled() -> Result<Bool, Error>