AR Foundation: Unsupported devices are passing enabled test.

I’m using the following code to check if a device is supported:

private void OnSystemStateChanged(ARSystemStateChangedEventArgs aRSystemStateChangedEventArgs)
        {
            ARSystemState = aRSystemStateChangedEventArgs.state;

            if (IsSupported == false)
            {
                if ((int)aRSystemStateChangedEventArgs.state == (int)ARSystemState.Ready)
                {
                    IsSupported = true;

                    if (PlayerPrefs.HasKey(GameConstants.AREnabled) == false)
                    {
                        ARSettingsChange(true);
                    }
                }
            }
        }

It works on most devices however some Apple devices are passing the test yet are not supported.

Devices that passed that shouldn’t include:

iPad Mini 2.
iPod Touch (5th generation)

I suspect you’re missing a file like this one: https://github.com/Unity-Technologies/arfoundation-samples/blob/master/Assets/link.xml

Due to an unfortunate bug in the IL2CPP linker, some methods (notably the one which checks device support) get stripped. That link.xml file forces it to be kept and should produce the correct behavior.

Thanks I’ll try that.

can u give a code for checking the compatibility of the phone

There is an explanation and sample code here: https://discussions.unity.com/t/720589