transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.54k stars 424 forks source link

[Android] Health apps requirement for accessing the ACTIVITY_RECOGNITION permission #2003

Closed PaitoAnderson closed 3 weeks ago

PaitoAnderson commented 3 weeks ago
Screenshot 2024-04-19 at 3 25 51 PM

Your Environment

Expected Behavior

No issues in Play Store

Actual Behavior

Received this message in the Play Store

Your app uses the android.permission.ACTIVITY_RECOGNITION permission and must meet Health apps policy requirements. If you don't have any health features in your app, remove this permission from your app's manifest.

Steps to Reproduce

  1. Add react-native-background-geolocation to App
  2. Publish on Play Store

Context

Publish on Play Store

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
christocracy commented 3 weeks ago

Yes, the plug-in uses the Motion API to automatically triggger location-tracking in the background. The Motion API comes under the umbrella of “Health”. The Play Store has become more strict about this permission, requiring you explain in detail why you’re using the motion API, which is to automatically trigger location-tracking in the background.

This is an accepted exemption for foreground-service launches.

see “Exemptions from background start restrictions“ in the Android Docs

IMG_0770

christocracy commented 3 weeks ago

The plug-in can, of course, operate without the motion api (it uses a Geofence around the last known position to detect movement). Your app will take longer distances to engage location-tracking (requiring movement of at least 200 meters)

PaitoAnderson commented 3 weeks ago

Is there a way to include react-native-background-geolocation without that permission? In our use case requiring a movement of at least 200 meters is OK.

The Play Store Health form isn't great and doesn't let you explain why you need it sadly, it's just an Other checkbox:

Screenshot 2024-04-19 at 3 58 05 PM

Thanks for the quick reply @christocracy

christocracy commented 3 weeks ago

See the last paragraph of my blog here to learn how to remove specific permissions from your app.