transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
651 stars 242 forks source link

Asking for always location permission every time app opens #1320

Closed sijanpoudel11 closed 5 months ago

sijanpoudel11 commented 5 months ago

Screenshot_1719570333 IMG_2642

Your Environment

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) • Android SDK at /Users/sijanpoudel/Library/Android/sdk • Platform android-34, build-tools 32.1.0-rc1 • ANDROID_HOME = /Users/sijanpoudel/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.14.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.90.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0

[✓] Connected device (3 available) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127 ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) ! Error: Browsing on the local area network for Touchware’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] HTTP Host Availability • All required HTTP hosts are available

Expected Behavior

After denying the background location permission , it'd not ask again for the permission .

Actual Behavior

Even after denying the always location permission it asks every time the app opens . Screenshot_1719570333

Steps to Reproduce

1. 2. 3. 4.

Context

send location data to an api on geofence enter/exit .

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
christocracy commented 5 months ago

locationAuthorizationRequest: 'Always',

Have you read the API docs for Config.locationAuthorizationRequest?

sijanpoudel11 commented 5 months ago

I missed it earlier , i saw it now . Thanks ,

sijanpoudel11 commented 4 months ago

Hello @christocracy i tried with these paramerets in Config . It works as expected on IOS but not in Android . Am i missing something here ? On Android the location popup is displayed on every open . I only want to ask for background location for first time .

locationAuthorizationRequest: 'Always', disableLocationAuthorizationAlert: true,