Log in or register to post comments

Customize camera permissions denied screen

January 22, 2019 - 4:39pm #1



On iOS, if the user denies camera access on the dialog prompt, Vuforia displays a screen stating as such. How do we customize it?

Customize camera permissions denied screen

January 29, 2019 - 5:01am #2

I did exactly that last week.

Go to the DefaultInitializationErrorHandler component.

Comment the OnGUI() method to get rid of that white and green screen (Vuforia should really create a proper prefab instead of using the GUI..). Take a look at the method SetErrorCode as you may want to re-use the mErrorText message from your own popup. You could also directly customize that class as you wish, beware if you update vuforia in the future :)

Please note that I am using Vuforia's DelayedInitialization mode.

In your game init class, right before you call VuforiaRuntime.Instance.InitVuforia(), type: VuforiaRuntime.Instance.RegisterVuforiaInitErrorCallback(OnVuforiaInitializationError);

The callback method is:

void OnVuforiaInitializationError(VuforiaUnity.InitError initError)
    Debug.LogError("Vuforia ERROR =  " + initError.ToString());

    // Call your own popup with your error message


Please note of this issue as you may receive a simple "Init error" when denying the camera permission : https://developer.vuforia.com/forum/unity/unity-android-camera-permission-denied-error-message

Log in or register to post comments