Home > Mobile >  How to disable location service in Flutter app?
How to disable location service in Flutter app?

Time:08-22

I have a Flutter source code. My code use geocoding and geolocator plugin for location services.

But my app won't need to access user's location so I want to disable this function.

Can you tell me how to remove location completely in the app? Thank you so much!

CodePudding user response:

Delete the package from pubspec.yaml. Check info. Plist and remove all location based keys. Check Android manifest and delete all location based keys here too

CodePudding user response:

First of all remove any permissions that exist from AndroidManifest.xml file:

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Then delete the related classes or methods from the source code.

  • Related