Additional Setup

flutter_map Installation & Setup

You must make sure you follow flutter_map's installation and additional setup instructions.

Platform Specific Setup

You may need to follow the instructions below depending on your platform. If your platform is not listed, that means no extra setup is necessary.

Android (Background Downloading Only)

This setup is only required if using background bulk downloading within your app.

Background Processes

Add the following to 'android\app\src\main\AndroidManifest.xml' and any other manifests:

AndroidManifest.xml
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="packageName">
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
 <application android:label="appName" android:icon="appIcon">

This will allow the application to acquire the necessary permissions (should the user allow them at runtime) to a background process.

  • FOREGROUND_SERVICE: allows the application to start a foreground service - a type of Android service that can run in the background, as long as the application isn't force stopped.

  • WAKE_LOCK: allows the background process (technically foreground service) to run even when the device is locked/asleep. Also allows the acquisition of a WiFi lock.

  • REQUEST_IGNORE_BATTERY_OPTIMIZATIONS (must be requested at runtime): assists with the background process not being killed by the system.

Notification Support

Android (Import/Export Only)

This setup is only required if using the prebuilt import/export functionality within your app.

Please follow these additional instructions for supporting Android versions above 11 and building for release:

iOS

Unfortunately, I do not have the hardware to test this library on Apple platforms. If you find issues, please report them!

It is unknown whether this setup is needed in all cases, so it is recommended to follow these only when you receive errors during building your app.

Some developers may have issues when releasing the app or uploading to TestFlight - see issue #69 for the first report of this problem. This is due to some of this library's dependencies on platform plugins.

  • Annotate that access is not needed to the Media, Audio, and Documents directories - this package uses only custom file types. Add these lines to your Podfile just before target 'Runner' do.

    Podfile
    Pod::PICKER_MEDIA = false
    Pod::PICKER_AUDIO = false
    Pod::PICKER_DOCUMENT = false
  • Add UIBackgroundModes capability with the fetch and remote-notifications keys to Xcode, to describe why your app needs to access background tasks - in this case to bulk download maps in the background.

Last updated

© Luka Stillingfleet (JaffaKetchup)