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

Backward Compatibility (1.3.3) #99

Open
makakaorg opened this issue Jan 1, 2023 · 3 comments
Open

Backward Compatibility (1.3.3) #99

makakaorg opened this issue Jan 1, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@makakaorg
Copy link

makakaorg commented Jan 1, 2023

Hi, I just updated from 1.3.3 to 1.3.7 and got next:

  • error CS7036: There is no argument given that corresponds to the required formal parameter 'isPicturePermission' of 'NativeCamera.RequestPermission(bool)'
  • error CS7036: There is no argument given that corresponds to the required formal parameter 'isPicturePermission' of 'NativeCamera.CheckPermission(bool)'

It seems that you added a parameter, without the default value (I guess, it will be FALSE for me).

I use your Asset in many of my assets on Asset Store, so please add the default value to this parameter (true or false) to have a backward compatibility and reduce negative emails to my support =)

P.S. Originally, I need a camera permission not for recording video or taking picture. I just need to use camera stream for AR Foundation to show the stream on the background of App (AR Foundation makes it automatically).

P.S.2. Native Gallery has the same issue with Media Type in the same functions.

@makakaorg makakaorg added the bug Something isn't working label Jan 1, 2023
@yasirkula
Copy link
Owner

I understand the problem. But the default parameter for CheckPermission wouldn't make sense here because we have to know how the user is planning to use the camera so that we can ask the right permission (I'm not a fan of the changes to permission system either but Android & iOS make big changes to the permission system from time to time and all I can do is adapting to those changes). Also, if we assume that the default value checks for picture permission, then it wouldn't work for you anyways because you're attempting to get the video permission.

Since your use-case is only asking for permissions, you can use AndroidRuntimePermissions or simply Unity's own Permission API to request camera permission on Android. On iOS, feel free to copy the permission related functions from my native code (a link to this repo in the native code would be appreciated but not needed). This way, you can eliminate the NativeCamera dependency. I can't recommend telling your users to use a previous release of NativeCamera because Android made a change in the permission system and thus, the previous releases won't work on Android 13 and newer (this issue was apparent in numerous plugins of mine but I've updated them all).

@makakaorg
Copy link
Author

makakaorg commented Jan 2, 2023

I checked the both values: true or false with AR Face Tracking. And the video stream works in the both cases.
Android 13, Galaxy A71, Unity 2021.3.16.

@yasirkula
Copy link
Owner

Yes because you're checking the camera permission only :D That permission is common in both cases. What changes is whether READ_MEDIA_IMAGES or READ_MEDIA_VIDEO is asked. It used to be READ_EXTERNAL_STORAGE only so a bool parameter wasn't necessary but now Android decided to split up that permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants