flutter_radar
package on pub.dev here.
pubspec.yaml
file:
ios/
directory. In the Podfile
, add platform :ios, '10.0'
or higher to your target.
On iOS, you must add location usage descriptions and background modes to your Info.plist
. Initialize the SDK in application:didFinishLaunchingWithOptions:
in AppDelegate.m
or AppDelegate.swift
, passing in your Radar publishable API key.
dependencies
section of your Android app’s build.gradle
file. Ensure the Android SDK version matches the version of your Radar Flutter package.
onCreate()
in MainApplication.java
, passing in your Radar publishable API key. If your Flutter Android app is in Kotlin, add a Application.kt
file and reference this as the application name in your Android manifest.
29
or higher, Radar also requires the ACCESS_BACKGROUND_LOCATION
permission. You must add the ACCESS_BACKGROUND_LOCATION
permission to your manifest manually:
Test Publishable
key for testing and non-production environments. Use your Live Publishable
key for production environments.
userId
is a stable unique ID for the user.
To set an optional dictionary of custom metadata for the user, call:
metadata
is a map with up to 16 keys and values of type string, boolean, or number.
Finally, to set an optional description for the user, displayed in the dashboard, call:
description
is a string.
You only need to call these functions once, as these settings will be persisted across app sessions.
Learn about platform-specific implementations of these functions in the iOS SDK documentation and Android SDK documentation.
status
will be a string, one of:
GRANTED_FOREGROUND
GRANTED_BACKGROUND
DENIED
NOT_DETERMINED
background
is a boolean indicating whether to request background location permissions or foreground location permissions.
Learn about platform-specific permissions in the iOS SDK documentation and Android SDK documentation.
EFFICIENT
: A low frequency of location updates and lowest battery usage. On Android, avoids Android vitals bad behavior thresholds.RESPONSIVE
: A medium frequency of location updates and low battery usage. Suitable for most consumer use cases.CONTINUOUS
: A high frequency of location updates and higher battery usage. Suitable for on-demand use cases (e.g., delivery tracking) and some consumer use cases (e.g., order ahead, “mall mode”).origin
to a destination
, we can call: