Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Problem handling permissions (ARFoundation + ARCore)

Discussion in 'AR' started by dylan-hart, Jul 24, 2019.

  1. dylan-hart

    dylan-hart

    Joined:
    Nov 10, 2016
    Posts:
    5
    I'm trying to replicate the permissions handling from the AR Elements android app: An initial screen displays rationale for the android.permission.CAMERA permission with a button that creates the permission request dialog. The rationale screen remains until the permission is granted (the permission request dialog can be created and denied any number of times). Once the permission is granted, the main app AR experience starts.

    Is there a way to do this using ARFoundation 2.1.1 + ARCore 2.1.0?

    I'm using ARCorePermissionManager's IsPermissionGranted() and RequestPermission() methods to check and request the permission. The camera remains black after granting the permission! The camera starts working only after restarting the app. Is there an ARFoundation/ARCore method I need to invoke after the permission is granted, or something else I need to do? In the RequestPermission() callback I've tried arSession.enabled = true and arSession.Reset(). The first doesn't appear to have any effect and the second crashes the app.