capacitor-background-runner icon indicating copy to clipboard operation
capacitor-background-runner copied to clipboard

Version 1.1.0 requires Permission ACCESS_BACKGROUND_LOCATION

Open louis123562 opened this issue 1 year ago • 4 comments

If we try to publish an internal release in the google play console, we get two errors, smth like that:

Error Your declaration of permissions for location determination in the background needs to be updated.

Error This release contains permissions that have not yet been explained in the Play Console. You can update the permissions declarations via the sensitive app permissions. Further information

I guess this comes from the Manifest in the background-runner sources itself.

image

In our own Manifest, we do not add ACCESS_BACKGROUND_LOCATION:

image

We are not in the need of accessing the GPS-Location with the background runner.

Is there a way to take the permission out?

louis123562 avatar Apr 26 '24 13:04 louis123562

In the manifest merger report, it is visible, that it comes from the background runner:

24-->[:capacitor-background-runner] /Users/l.spieckerhoff/workspace/repositories/planzeit-ionic-v5-neu/node_modules/@capacitor/background-runner/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml:11:5-77
24-->[:capacitor-background-runner] /Users/l.spieckerhoff/workspace/repositories/planzeit-ionic-v5-neu/node_modules/@capacitor/background-runner/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml:11:22-74
25    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

louis123562 avatar Apr 26 '24 13:04 louis123562

Yeah, this has been a known potential issue on iOS as well.

Im working on a potential solution to this that may come in the form of a CLI that will help add / remove APIs and their relevant permissions (in addition to removing unused API code, which could be an issue as well).

theproducer avatar Apr 26 '24 20:04 theproducer

Yeah, to solve this issue temporarily, i deleted the lines in the AndroidManifest.xml in node_modules.

louis123562 avatar Apr 30 '24 07:04 louis123562

Workaround for iOS: When not checking "Location updates" in Background Modes, the iOS app crashes on the first dispatchEvent. If you do not need to track the gps location with the runner, disable the functionality in node_modules:

image

louis123562 avatar May 06 '24 14:05 louis123562