System requirements
On devices that cannot receive positioning data, the SDK stops itself and does not affect the rest of your app.
Installing the SDK
1
Add the package from pub.dev.To add it manually, put it under dependencies in
pubspec.yaml.pubspec.yaml
2
Import it in your Dart code.
Dart
iOS setup
1
Enable Swift Package Manager
2
Raise the deployment target
Raise
IPHONEOS_DEPLOYMENT_TARGET in ios/Runner.xcodeproj to 18.0.3
Add the usage descriptions
Add all five usage descriptions below to
ios/Runner/Info.plist. None of them can be left out. For how to add them, see the iOS Setup Guide.Info.plist
Android setup
1
Change MainActivity
The SDK’s permission request needs a
ComponentActivity, so change MainActivity to FlutterFragmentActivity.MainActivity.kt
2
Match the build versions
android/app/build.gradle.kts
Initializing the SDK
Runs the initialization needed to start the positioning engine.
Every call returns a
Future, and events are Streams.
Dart
Profiles
Each user (account or device) is tracked as a profile.Profile IDs are unique and cannot be recovered once lost, so store them carefully.
Creating a profile
Creating a profile returns its profile ID. Attributes are used as segments in reports and metrics, and there are no restrictions on the key-value pairs.Store the returned ID in your app (or on your server) and link it with
identify before positioning on every launch.
Dart
Fetching a profile
Fetches the personalization attributes stored for a profile ID.Dart
Updating a profile
Personalization attributes are replaced as a whole. The previous values are deleted and cannot be restored.Dart
Deleting a profile
Deletes the profile’s personalization attributes. Deleted attributes cannot be restored.Dart
Selecting a building and floor
To receive position coordinates, select the building and floor where the locators are installed.Selecting from BLE
When the SDK’s positioning engine finds a floor from locator BLE signals, the floor ID arrives inonFloorDetected. null arrives when the floor is lost.
Dart
Selecting manually
Set the building and floor yourself when the user picks the floor, or when you want to draw the map before positioning starts.Dart
Receiving live positions
Get a positioning session withfloorSession(), start it with begin() and stop it with end(). Positions arrive in
onPosition as coordinates in meters, up to 4 times per second.
Dart
Zone events
Receive enter, exit and dwell events for the zones drawn in the console’s Space Management. Detection happens on the device, so events arrive immediately.Campaigns attached to a zone (coupons, signage, etc.) are matched by the server and delivered through
onTriggers.Every event is a
Stream, so you can listen from several places at once.
Dart
Refreshing zone data
onConfigChanged emits when zone data changes in the console. If several arrive in a row, batch them for about a second and call refreshZones() once.
Dart
Displaying the floor plan
You can display the floor plan the locators are installed on, together with the user’s current position.If no floor plan is set, the background is shown as a grid.
Dart
Other options
Controlling data upload
Coordinates are uploaded automatically when 300 have been buffered, or 60 seconds after the last upload. If the app is force-quit, buffered coordinates are discarded.Dart
Resetting the session
Discards the current session. No new session is created; callinitialize again to continue (a different key also works).
Dart
Handling positioning shutdown
When the positioning engine shuts down,onStopped fires and you can bring the app back to a state where positioning can start again.
Dart
Checking device support
deviceAvailability can be read right away without a network (internet) connection.Devices that do not support positioning do not affect the rest of your app.
Dart
Appendix
Requesting permissions
requestPermission() requests every permission the SDK needs in one go. Once the user has denied a request, the app cannot ask again, so guide them to the Settings app.
Dart
Debug logs
To see debug logs, register the listener right before callinginitialize. Logs are printed in the terminal running
flutter run or in the IDE’s debug console. To collect them on the device itself, see the iOS and Android guides.
User positioning data cannot be checked on simulators or emulators.
Dart
setLanguage — 'ko' · 'ja' · 'en'; null follows the device language.
Dart
Differences from the native SDKs
Troubleshooting
Error codes
Explains the errors you may run into during development.