StansAssets / com.stansassets.android-native

Android Native Plugin Wiki
https://api.stansassets.com/android-native/
9 stars 1 forks source link

Typo in AN_Camera.cs causes unintended "User denied permission." error. #34

Closed LosoncziTamas closed 3 years ago

LosoncziTamas commented 3 years ago

Steps to reproduce:

Expected result:

Actual result:

I found that the issue was caused by a missing negation in an if statement:

        public static void CaptureImage(int maxSize, Action<AN_CameraCaptureResult> callback)
        {
            AN_PermissionsUtility.TryToResolvePermission(
                CameraApiCameraApiRequiredPermissions,
                granted =>
                {
                    if (granted)
                    {
                        var result = new AN_CameraCaptureResult(new SA_Error(9, "User denied permission."));
                        callback.Invoke(result);
                        return;
                    }
             //...

I'm using Android Native version 2020.10.2.

stan-osipov commented 3 years ago

Thx for the report! Fixed.