Location and Beacons - optimove-tech/Optimove-SDK-Flutter GitHub Wiki
Location Tracking
You can send to Optimove location updates and use this to trigger events such as push notifications when an install enters a geofence.
Once you got the location data, you can send it to Optimove like so:
import 'package:optimove_flutter/optimove_flutter.dart' as optimove;
//...
// in the following example, location data was obtained using a location package https://pub.dev/packages/location
LocationData locationData = await location.getLocation();
Optimove.sendLocationUpdate(optimove.Location(longitude: locationData.longitude!, latitude: locationData.latitude!, time: locationData.time!));
Beacon Detection
You can send to Optimove beacon proximity updates and use these to trigger a campaign when an install is in proximity to a beacon.
Eddystone Beacon Detection
The Optimove SDK provides a helper method to notify our services of proximity to a detected Eddystone beacon.
Optimove.trackEddystoneBeaconProximity(EddystoneBeaconProximity(hexNamespace: hexNamespace, hexInstance: hexInstance, distanceMetres: distanceMetres));
Beacon monitoring on Android typically requires a device with BLE, and API level 18+. You can read more about detecting beacons in the Android Nearby reference.
Eddystone beacon detection on iOS has limitations. For example, many of Core Bluetooth tasks are disabled when your app is in the background or in a suspended state.