How do I use Apple ARKit on older devices?

With iOS 11 beta, ARKit Apps crashes even when using 3DOF, which should be compatible with older devices? And how can I prevent the application from crashing if ARKit is not supported?

+3


source to share


1 answer


Supported Devices

Since iOS 11, you cannot use ARKit for older devices:

Important

ARKit requires an iOS device with an A9 processor or later.

To make your app available only on ARKit-enabled devices, use arkit in the UIRequiredDeviceCapabilities section of your Info.plist app. If augmented reality is a secondary feature of your application, use the isSupported property to determine if the current device supports the session configuration you want to use.

The device must have an A9 processor or later. You can only use:

  • iPhone SE,
  • iPhone 6S and newer (7, 8, X),
  • iPad (2017) or newer
  • iPad Pro (any).


Preventing crashes

To prevent your application from crashing, you can use the isSupported property ARConfiguration

. And don't forget to check your current iOS version.

import ARKit

func isARSupported() -> Bool {
    guard #available(iOS 11.0, *) else {
        return false
    }
    return ARConfiguration.isSupported
}

if isARSupported() {
    // ARKit is supported. Do what you need.
} else {
    // ARKit is not supported.
}

      

Before attempting to create an AR configuration, verify that the user device supports the configuration you plan to use by checking the isSupported property of the appropriate configuration class. If this property value is false, the current device does not support the requested configuration.

+7


source







All Articles