react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Manually request motion permissions

Open sirusbaladi opened this issue 1 year ago • 2 comments

Hi,

I'm aware that there's a method to manually trigger location permissions, is there a similar way to trigger the permission for the motion sensors?

The expo library to do so seems to not work and I like to request the permission during user onboarding one by one.

thank you

sirusbaladi avatar Jul 25 '24 20:07 sirusbaladi

bump

sirusbaladi avatar Aug 17 '24 20:08 sirusbaladi

I guess you can use https://github.com/zoontek/react-native-permissions and ask for PERMISSIONS.IOS.MOTION PERMISSIONS.ANDROID.ACTIVITY_RECOGNITION

sanduluca avatar Aug 21 '24 16:08 sanduluca

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 21 '24 02:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 05 '24 02:10 github-actions[bot]

Yes, we can manually request using https://github.com/zoontek/react-native-permissions but is there a way to disable the default pop-up for "Motion&Fitness" permission within package?

MufeedaFi avatar Nov 28 '24 11:11 MufeedaFi

is there a way to disable the default pop-up for "Motion&Fitness" permission within package?

do you understand the consequences of the plug-in not having motion permission? They are not minor.

christocracy avatar Nov 28 '24 12:11 christocracy

is there a way to disable the default pop-up for "Motion&Fitness" permission within package?

do you understand the consequences of the plug-in not having motion permission? They are not minor.

Would it be affected if we handle that permission explicitly? ie, for eg; by requesting it during onboarding manually as we need a custom screen only for handling that, and disabling the default request pop-up from geolocation package?

MufeedaFi avatar Nov 28 '24 15:11 MufeedaFi

See API docs Config.disableMotionActivityUpdates. Set it to false. Once you have Motion Permission, set it to true using .setConfig.

christocracy avatar Nov 28 '24 15:11 christocracy

See API docs Config.disableMotionActivityUpdates. Set it to false. Once you have Motion Permission, set it to true using .setConfig.

Hey, don't really understand.

My requirement is that, the "Motion and fitness" permission should ONLY be asked only when user clicks a button "Enable permission" and it should NOT be asked implicitly just beacuse I use the package. And the way to disable the one from package is to set disableMotionActivityUpdates: true. And then I can request that permission manually using react-native-permissions as required on the button click.

So, my question is, will this approach has any consequences of the plug-in not having motion permission? Or will this affects the geolocation lib functionalities somehow?

MufeedaFi avatar Nov 28 '24 15:11 MufeedaFi

will this approach has any consequences of the plug-in not having motion permission?

no. The plugin doesn't care how permission is achieved. Permissions are granted to your app.

christocracy avatar Nov 28 '24 15:11 christocracy

will this approach has any consequences of the plug-in not having motion permission?

no. The plugin doesn't care how permission is achieved. Permissions are granted to your app.

Ok, so this approach is fine I think. Thank you!

MufeedaFi avatar Nov 28 '24 15:11 MufeedaFi

https://github.com/zoontek/react-native-permissions?tab=readme-ov-file#ios

By default, no permissions are available

(followed by lots of detailed setup instructions - I'm guessing something is missed)

mikehardy avatar Nov 28 '24 18:11 mikehardy