DartBridgeDevice class

Device bridge for C++ device manager operations. Matches Swift's CppBridge+Device.swift.

Provides callbacks for:

  • Device info gathering (via device_info_plus)
  • Device ID retrieval (via shared_preferences + unique ID)
  • Registration persistence (via shared_preferences)
  • HTTP transport (via http package)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getDeviceId() Future<String>
Get the cached or generated device ID
isDeviceRegistered() bool
Check if device is registered with backend
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

cachedDeviceId String?
Get the cached device ID synchronously (null if not yet cached)
no setter
cachedDeviceModel String
Device model from the canonical registration snapshot.
no setter
instance DartBridgeDevice
final

Static Methods

flushPendingRegistrationPost() Future<void>
Execute the device-registration HTTP request captured by the C callback. Commons owns the rac_device_manager_register_if_needed call; Flutter only drains the request because Dart FFI callbacks cannot await network I/O.
register({required SDKEnvironment environment, String? baseURL, String? accessToken}) Future<void>
Register device callbacks with C++ (full async init, Phase 2) Must be called during SDK init after platform adapter
registerCallbacks() → void
Register device callbacks synchronously (Phase 1). Matches Swift: Device.register() in CppBridge.initialize() This registers the C++ callbacks without initializing SharedPreferences or caching device ID (those happen in Phase 2).
setAccessToken(String? token) → void
Update access token (called after authentication)
shutdown() → void
Clear process-local device state after native callbacks are quiescent. Durable identity and registration values remain in platform storage.