Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android 13 camera permissions #1486

Closed
wants to merge 1 commit into from
Closed

Conversation

ckarmy
Copy link
Contributor

@ckarmy ckarmy commented Sep 13, 2023

This is an approach to solving the permissions problem (#1481). It works but I don't have much knowledge of native code.

I think the code needs to be polished a little.

Copy link
Member

@mortend mortend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing the solution to this.

#1487 contains a cleaned up version, fixing the things I commented on here.

Comment on lines +211 to +217
public static PlatformPermission READ_EXTERNAL_STORAGE { get { return Internal.Android._read_media_images(); } }
public static PlatformPermission READ_MEDIA_IMAGES { get { return
Internal.Android._read_media_audio(); } }
public static PlatformPermission READ_MEDIA_AUDIO { get { return
Internal.Android._read_media_video(); } }
public static PlatformPermission READ_MEDIA_VIDEO { get { return
Internal.Android._read_external_storage(); } }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit strange, like the return values are rotated:

READ_EXTERNAL_STORAGE -> _read_media_images
READ_MEDIA_IMAGES -> _read_media_audio
READ_MEDIA_AUDIO -> _read_media_video
READ_MEDIA_VIDEO -> _read_external_storage

[Foreign(Language.Java)]
public int CheckSDKVersion()
@{
return android.os.Build.VERSION.SDK_INT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AndroidProperties.BuildVersion can be used to get this value in Uno

@mortend
Copy link
Member

mortend commented Oct 2, 2023

Superseded by #1487

@mortend mortend closed this Oct 2, 2023
@ckarmy
Copy link
Contributor Author

ckarmy commented Oct 10, 2023

@mortend I tested it, but it's not working. I'm getting an error message that says, 'Permissions: Permissions denied,' even though I have all the necessary permissions granted within the app. Something seems to have changed that is causing it to not work with respect to my code.

@ckarmy
Copy link
Contributor Author

ckarmy commented Oct 10, 2023

@mortend I think the problem is in this validation:
image

@ckarmy
Copy link
Contributor Author

ckarmy commented Oct 10, 2023

@mortend In Build Version >= 33, it consistently indicates that the permissions have not been granted, even though they have been. I've reviewed my code, and I've forced it to always return that the permissions are granted...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants