Skip to content

Version 2.3.5 not returning array [status:Status, always:boolean] but just a string with status e.g. "authorized" #31

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

Open
harfyt opened this issue Nov 27, 2024 · 1 comment

Comments

@harfyt
Copy link

harfyt commented Nov 27, 2024

Hello all,

I am using this plugin indirect through @nativescript/geolocation plugin at version ^9.0.0

It was working fine until i cleaned the app and re-build it.
Then the method geolocation.isEnabled() stopped giving true as result even if I have given every single location permission.
Diggin inside the plugging I found the cause for this in the following code:

async function hasFineAndCoursePermission() {
    const accessFine = await permissions.check('android.permission.ACCESS_FINE_LOCATION');
    const accessCourse = await permissions.check('android.permission.ACCESS_COARSE_LOCATION');
    const hasAccessFine = authorizedStatus.includes(accessFine[0]) && accessFine[1] === true;
    const hasAccessCourse = authorizedStatus.includes(accessCourse[0]) && accessCourse[1] === true;
    return hasAccessFine && hasAccessCourse;
}

The problem is that both results of permission.check() were a single string "authorized" and not an array as supposed to.

I found that after the rebuilding of my app (through package-lock.json) that "@nativescript-community/perms" had gone from 2.3.3 to 2.3.5

When manually added the plugin to my app back to 2.3.3 the result was back to the expected
[status:Status, always:boolean]

Thanks,
Harry

@farfromrefug
Copy link
Member

@harfyt my bad. I released something which should come next in a major version change!
Just published a new version ot fix that. Sorry

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

No branches or pull requests

2 participants