react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Allow app to access your physical activity with disabled disableMotionActivityUpdates flag
Your Environment
- Plugin version: 4.12.1
- Platform: Android
- OS version:
- Device manufacturer / model:
- React Native version (
react-native -v): 0.69.10 - Plugin config
export const locationConfig = {
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
stationaryRadius: 15, // <-- Default: 25. When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.
distanceFilter: 10, // <-- The minimum distance (measured in meters) a device must move horizontally before an update event is generated.
title: "App is Running in Background.",
text: "",
debug: false,
startOnBoot: false, // <-- Auto start tracking when device is powered-up.
stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
locationAuthorizationRequest: "Always",
backgroundPermissionRationale: {
title: "...",
message: `...`,
positiveAction: "..."
},
locationUpdateInterval: 5000,
disableMotionActivityUpdates: true
};
Expected Behavior
modal does not appear in app
Actual Behavior
I see this modal in app with disableMotionActivityUpdates: true
and I init service after BG.ready()
Steps to Reproduce
Context
Debug logs
Logs
PASTE_YOUR_LOGS_HERE
I cannot reproduce this.
Either you are:
- calling
.start()before calling.ready(config) - Configuring the plugin with
reset: false - Some other plugin is requesting Motion permission.
If the plugin is configured with disableMotionActivityUpdates: false (ie: do NOT disable), you will see this in the logs:
07-12 11:47:33.004 11961 12103 D TSLocationManager: 🎾 Start monitoring connectivity changes
(Mistake above)
If the plugin is configured with disableMotionActivityUpdates: false (ie: do NOT disable), you will see this in the logs:
07-12 11:54:23.386 13693 13823 I TSLocationManager: 🎾 Start motion-activity updates
@christocracy
2. Configuring the plugin with reset: false
It works. Thank you. Can be closed
Why were you hiding that Config and not showing it here?
@christocracy
Actually 2. Configuring the plugin with reset: false didn't help. Modal appears ifdisableMotionActivityUpdates: true and reset: false.
my config
this from my app permissions. How can I remove "Physical Activity" permission from app. I do not use another location service.
I don't think you understand what reset: false is. 99% of users should not use reset: false. It causes the plugin to IGNORE the Config provided to ready(config).
@christocracy when I do not use 'reset: false' modal with 'physical activity' permission appears if disableMotionActivityUpdates is true
@christocracy How can I remove 'Physical Activity' permission on native level?
I have no idea what you're doing wrong, but you're doing something wrong.
Create for me a simple HelloWorld that reproduces this. Share your simple HelloWorld in a public github repo here.
Do NOT use reset: false.
Why does "Physical Activity" permission display in permissions settings?
Because that permission is included in the plugin's own AndroidManifest
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
Can I see it in node_modules?
no.
but if app does not use it, why is it important setting?
If your issue is the Physical Activity permission is being requested in spite of disableMotionActivityUpdates: true, you're doing something wrong.
Create for me a simple HelloWorld app which reproduces the problem.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.