Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ARKit on older iOS devices?

With beta version of iOS 11, ARKit apps crash even when using 3DOF which should be compatible with older devices?

And how can I prevent app crash, if ARKit is not supported?

like image 365
SomeUser Avatar asked Dec 24 '22 16:12

SomeUser


1 Answers

Supported Devices

As of iOS 11, you can't use ARKit on old devices:

Important

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

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

Device should have A9 or later processor. You can use only:

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

Preventing Crashes

To prevent app crash, you can use isSupported property of ARConfiguration. And don't forget to check 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’s device supports the configuration you plan to use by checking the isSupported property of the corresponding configuration class. If this property’s value is false, the current device does not support the requested configuration.

like image 169
Vasilii Muravev Avatar answered Jan 03 '23 21:01

Vasilii Muravev