B Bubbl Docs

Flutter SDK Method Reference

Reference for BubblFlutterSdk in package:bubbl_flutter_sdk/bubbl_flutter_sdk.dart.

Streams

notificationEvents(): Stream<Map<String, dynamic>>

Notification payload stream.

geofenceEvents(): Stream<Map<String, dynamic>>

Geofence snapshot stream (stats, polygons, circles).

deviceLogEvents({options}): Stream<Map<String, dynamic>>

Device log snapshot stream.

Boot and Permissions

boot({apiKey, options}): Future<BubblBootResult>

Initializes runtime and stores tenant config.

init({apiKey, options}): Future<BubblBootResult>

Alias-compatible init path.

requiredPermissions(): Future<List<String>>

Returns required permission identifiers.

locationGranted(): Future<bool>

Checks current location permission state.

notificationGranted(): Future<bool>

Checks current push notification permission state.

requestPushPermission(): Future<bool>

Requests push permission.

startLocationTracking(): Future<bool>

Starts location-tracking flow after boot.

Tracking and Campaigns

refreshGeofence({latitude, longitude}): Future<void>

Triggers geofence refresh with explicit coordinates.

hasCampaigns(): Future<bool>

Returns whether campaigns are currently available.

getCampaignCount(): Future<int>

Returns campaign count from latest state.

forceRefreshCampaigns(): Future<bool>

Forces campaign refresh.

clearCachedCampaigns(): Future<void>

Clears cached campaigns.

Segmentation and Identity

updateSegments(tags): Future<bool>

Pushes segmentation tags.

setCorrelationId(correlationId): Future<bool>

Sets persistent correlation id for current device/session.

getCorrelationId(): Future<String>

Reads current correlation id.

clearCorrelationId(): Future<bool>

Clears current correlation id.

Configuration and Privacy

getCurrentConfiguration(): Future<BubblConfiguration?>

Returns cached configuration summary.

getPrivacyText(): Future<String>

Returns cached privacy text.

refreshPrivacyText(): Future<String>

Refreshes and returns privacy text.

Notification and Survey Analytics

sendEvent(params): Future<bool>

Generic analytics event wrapper.

cta({notificationId, locationId}): Future<void>

Tracks CTA engagement.

trackSurveyEvent({notificationId, locationId, activity}): Future<bool>

Tracks lifecycle/survey activity events.

submitSurveyResponse({notificationId, locationId, answers}): Future<bool>

Submits structured survey responses.

Tenant Config

getTenantConfig(): Future<BubblTenantConfig?>

Reads saved tenant metadata.

setTenantConfig({apiKey, environment}): Future<bool>

Persists tenant config for next boot.

clearTenantConfig(): Future<bool>

Clears stored tenant config.

clearStoredConfig(): Future<bool>

Clears tenant config and resets plugin-side init state.

Device Logs and Utilities

getDeviceLogStreamInfo(): Future<Map<String, dynamic>>

Returns device log stream identity info (deviceType, deviceId, deviceIdSuffix).

getDeviceLogTail({maxLines}): Future<List<String>>

Returns latest log tail lines.

startDeviceLogStream({options}): Future<Map<String, dynamic>>

Starts periodic log snapshots.

stopDeviceLogStream(): Future<void>

Stops device-log stream.

getApiKey(): Future<String>

Returns active API key from native runtime context.

sayHello(): Future<String>

Bridge sanity check method.

testNotification(): Future<bool>

Triggers local test notification and stream event.

Core model types

BubblBootOptions

const BubblBootOptions({
  BubblEnvironment environment = BubblEnvironment.staging,
  List<String> segmentationTags = const <String>[],
  int? geoPollIntervalMs,
  int? defaultDistance,
})

BubblBootResult

class BubblBootResult {
  final bool initializedNow;
  final bool alreadyInitialized;
  final bool restartRequiredForTenantChange;
}

BubblEnvironment

  • BubblEnvironment.development
  • BubblEnvironment.staging
  • BubblEnvironment.production

Environment Note

For cross-platform parity, prefer staging and production. Android currently treats non-PRODUCTION values as STAGING.