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

Permission Problem After Marshmallow #38

Open
WrathChaos opened this issue Jan 19, 2018 · 3 comments
Open

Permission Problem After Marshmallow #38

WrathChaos opened this issue Jan 19, 2018 · 3 comments

Comments

@WrathChaos
Copy link

Hello,
Thanks for great library.
I got a problem about permissions.. If user has no permissions on Camera and Storage, MagicalCamera itself cannot handle it and "return mapPermissions?.get(permission)!!" returns NullPointerException. (Tried on both Java and Kotlin)


 private fun isActivePermission(permission: String): Boolean {
        // This map is return in method onRequestPermissionsResult for view what permissions are actives
        if (android.os.Build.VERSION.SDK_INT >= 23) {
            if (mapPermissions != null) {
                if (mapPermissions!!.size > 0) {
                    // Obtain the code of camera permissions
                     return mapPermissions?.get(permission)!!
                } else {
                    return true
                }
            } else {
                return true
            }
        } else {
            return true
        }
    }

I could not solve the problem, please help me.
Thank you

@WrathChaos
Copy link
Author

WrathChaos commented Feb 19, 2018

Edit: Solved the issue but the main issue is still remaining.. Waiting for a response.
Edit2: I have another problem; when I pick a photo from gallery, MagicalCamera simply duplicate the selected photo and create the one more same photo. How to fix this issue?
Thank you,
Have fun :)

@fabian7593
Copy link
Owner

Hello @WrathChaos , thanks for use magical camera project, and thanks for report the issues.
I need to review the first issue, but I never thought that someone use magical camera withouth permissions.
and for issue 2, I do not understand the problem very well, magical camera dont duplicate photo if you not required this, for example if you dont save the selected picture, well, its occurs to me that verify if photo is selected or new photo, for save this or not...

@WrathChaos
Copy link
Author

Hello @fabian7593,
I use magical camera with permissions, but after Marshmallow we have to ask user to request permissions. Even I got the permissions, "return mapPermissions?.get(permission)!!" this part never works for me after Marshmallow. I just return true but then I have to ask that part 2 times in a row to open the camera or library. I could not figure it out :(
I will share my codes about the duplicate problem.. Then I believe that you can re-produce my issue :)

Thank you

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

No branches or pull requests

2 participants