Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.06k stars 1.15k forks source link

[Bug] ARCorePermissionManager should handle requesting and onpause situation #908

Closed flankechen closed 2 years ago

flankechen commented 2 years ago

Describe the bug When requesting permission with ARCorePermissionManager by ARCorePermissionManager.RequestPermission(String, Action<String, Boolean>), if user click home button and resume back to app. Permission requesting window is gone and No granted callback is called. We have no ways to resume permission request or raise another permission request. if call RequestPermission() again, exception like : if (s_CurrentCallback != null) throw new InvalidOperationException("Cannot start a new permissions request before the current one finishes."); happened.

To Reproduce Steps to reproduce the behavior: 1.equesting permission with ARCorePermissionManager by ARCorePermissionManager.RequestPermission(String, Action<String, Boolean>) 2.user click home button go to home screen and resume back to app 3.Permission requesting window is gone and No granted callback is called

Expected behavior permission request window keeps when onpause and onresume. or a callback is called.

Smartphone (please complete the following information):

DavidMohrhardt commented 2 years ago

Could you file a bug for this: https://unity3d.com/unity/qa/bug-reporting.

flankechen commented 2 years ago

@DavidMohrhardt done reporting it in unity. it should be easy to reproduce. thanks

ankur-unity commented 2 years ago

@flankechen - Can you post the bug id here?

ankur-unity commented 2 years ago

The bug has been reproduced. Use the following link to follow the progress on a fix: https://issuetracker.unity3d.com/issues/arfoundation-camera-request-permission-window-is-not-shown-when-app-is-minimized-and-opened-again-on-android-device

andyb-unity commented 2 years ago

Added a new API to cancel permission request in Google ARCore XR Plug-in 5.0.0-pre.12: https://docs.unity3d.com/Packages/com.unity.xr.arcore@5.0/changelog/CHANGELOG.html#added-1