private void _OnCheckApkAvailabilityResult(ApkAvailabilityStatus status)
 {
     foreach (var onComplete in m_PendingAvailabilityCheckCallbacks)
     {
         onComplete(status);
     }
     m_PendingAvailabilityCheckCallbacks.Clear();
 }
示例#2
0
    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;
        }
        yield return(new WaitForSeconds(2f));

        SwipeImage.SetActive(false);
    }
示例#3
0
    private IEnumerator CheckAvailability()
    {
        // Async getting current apk availability and waiting for it
        AsyncTask <ApkAvailabilityStatus> statusTask  = Session.CheckApkAvailability();
        CustomYieldInstruction            customYield = statusTask.WaitForCompletion();

        yield return(customYield);

        // offset by 2 second just in case getting the status is too fast
        yield return(new WaitForSeconds(2));

        status = statusTask.Result;
        switch (status)
        {
        // If apk is installed and usable load main menu
        case ApkAvailabilityStatus.SupportedInstalled:
            sceneChange.SceneLoader(1);
            break;

        // Handling every type of Error output, except UnknownChecking which is only a middle state before ending in one of the following
        case ApkAvailabilityStatus.SupportedApkTooOld:
            errorMessage = "  ARCore is supported but the apk is too old. Please update Google Play Services for AR and relaunch the application.";
            break;

        case ApkAvailabilityStatus.SupportedNotInstalled:
            errorMessage = "  ARCore is supported but not installed. Please install Google Play Services for AR from the Play Store and relaunch the application.";
            break;

        case ApkAvailabilityStatus.UnsupportedDeviceNotCapable:
            errorMessage = "  ARCore is not supported on this device. Please use a device that is offically supported by Google. The device is supported if Google Play Services for AR is available in the Play Store.";
            break;

        case ApkAvailabilityStatus.UnknownError:
            errorMessage = "  The ARCore compatibility check has ran into an unexpected Error. You may run into this issue if your device has a modified OS "
                           + "if that's not the case and it supports Google Play Services for AR please post an issue on my Github page and I will get back to you asap.";
            break;

        case ApkAvailabilityStatus.UnknownTimedOut:
            errorMessage = "  The ARCore compatibility check has been timed out. Please make sure Google Play Services for AR is installed and updated on your device and restart the application. "
                           + "if the problem persists please post an issue on my Github page and I will get back to you.";
            break;
        }
    }
示例#4
0
    private IEnumerator CheckCompatibility()
    {
        AsyncTask <ApkAvailabilityStatus> checkTask   = Session.CheckApkAvailability();
        CustomYieldInstruction            customYield = checkTask.WaitForCompletion();

        yield return(customYield);

        ApkAvailabilityStatus result = checkTask.Result;

        testHardwareMessage.gameObject.SetActive(true);
        switch (result)
        {
        case ApkAvailabilityStatus.SupportedApkTooOld:
            testHardwareMessage.text = "Supported apk too old";
            break;

        case ApkAvailabilityStatus.SupportedInstalled:
            Destroy(testHardwareMessage.gameObject);
            AllGoodStartApp();
            break;

        case ApkAvailabilityStatus.SupportedNotInstalled:
            StartCoroutine(CheckInstall());
            testHardwareMessage.text = "Supported, not installed, requesting installation";
            break;

        case ApkAvailabilityStatus.UnknownChecking:
            testHardwareMessage.text = ("Unknown Checking");
            break;

        case ApkAvailabilityStatus.UnknownError:
            testHardwareMessage.text = ("Unknown Error");
            break;

        case ApkAvailabilityStatus.UnknownTimedOut:
            testHardwareMessage.text = ("Unknown Timed out");
            break;

        case ApkAvailabilityStatus.UnsupportedDeviceNotCapable:
            testHardwareMessage.text = ("Unsupported Device Not Capable");
            break;
        }
    }
示例#5
0
 /// <summary>
 /// Sets the simulated ARCore apk availability status
 /// </summary>
 /// <param name="apkAvailabilityStatus">The new apk availability status</param>
 public static void SetARCoreAvailabilityStatus(ApkAvailabilityStatus apkAvailabilityStatus)
 {
     EazyARSession.apkAvailabilityStatus = apkAvailabilityStatus;
 }