How to use ARCore Session.CheckApkAvailability (); ?

Could you tel me how to use Session.CheckApkAvailability (); ?

I have try different ways without any success:

  1. await Session.CheckApkAvailability ();
  2. if (Session.CheckApkAvailability ().Result == ApkAvailabilityStatus.SupportedInstalled)
  3. Session.CheckApkAvailability ();
    while (!Session.CheckApkAvailability ().IsComplete) {}

Thanks a lot

Try this: (Tested on Samsung Galaxy S7 Edge)

   private IEnumerator CheckCompatibility()
{
    AsyncTask<ApkAvailabilityStatus> checkTask = Session.CheckApkAvailability();
    CustomYieldInstruction customYield = checkTask.WaitForCompletion();
    yield return customYield;

    ApkAvailabilityStatus result = checkTask.Result;

    switch (result)
    {
        case ApkAvailabilityStatus.SupportedApkTooOld:
            _ShowAndroidToastMessage("Supported apk too old");
            break;
        case ApkAvailabilityStatus.SupportedInstalled:
            _ShowAndroidToastMessage("Supported and installed");
            break;
        case ApkAvailabilityStatus.SupportedNotInstalled:
            _ShowAndroidToastMessage("Supported, not installed, requesting installation");
            Session.RequestApkInstallation(false);
            break;
        case ApkAvailabilityStatus.UnknownChecking:
            _ShowAndroidToastMessage("Unknown Checking");
            break;
        case ApkAvailabilityStatus.UnknownError:
            _ShowAndroidToastMessage("Unknown Error");
            break;
        case ApkAvailabilityStatus.UnknownTimedOut:
            _ShowAndroidToastMessage("Unknown Timed out");
            break;
        case ApkAvailabilityStatus.UnsupportedDeviceNotCapable:
            _ShowAndroidToastMessage("Unsupported Device Not Capable");
            break;
    }
}

All you need is to call StartCoroutine(CheckCompatibility()); from Start method
(_ShowAndroidToastMessage method taken from ComputerVisionController class)

It’s work on Samsung A6 too, but we need to check which platform using before “StartCoroutine”, an error happen when runing on UNITY_EDITOR.
How to check platform: here