Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARKit: how to correctly check for supported devices?

Tags:

ios

iphone

arkit

I'm using ARKit but it is not a core functionality in my app, so I'm not setting the arkit key in the UIRequiredDeviceCapabilities. I'm setting the directive @available(iOS 11.0, *), but ARKit requires an A9 processor or above (that is, iPhone 6S or newer...)

What the best way to check that? I've found a workaround that involves checking the device model in several places, but it looks like it's a bit complicated. And would this be rejected in a review for the Store?

like image 460
AppsDev Avatar asked Dec 10 '22 09:12

AppsDev


2 Answers

You should check the isSupported boolean provided by the ARConfiguration class for this.

From the Apple Developer Documentation:

isSupported

A Boolean value indicating whether the current device supports this session configuration class.

All ARKit configurations require an iOS device with an A9 or later processor. If your app otherwise supports other devices and offers augmented reality as a secondary feature, use this property to determine whether to offer AR-based features to the user.

like image 133
Tamás Sengel Avatar answered Dec 25 '22 07:12

Tamás Sengel


Just check ARConfiguration availability.

if (ARConfiguration.isSupported) {

      // Great! let have experience of ARKIT
} else {
     // Sorry! you don't have ARKIT support in your device
}
like image 41
Prabakaran Avatar answered Dec 25 '22 08:12

Prabakaran