DeviceService provides core device management and key/token management. All RPCs require authentication via Bearer token unless otherwise specified.
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
-
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
Constants
-
addKey
→ const Spec<
AddKeyRequest, AddKeyResponse> - AddKey stores a key or token and its material in the local storage for a device. This is used for keys generated by the service or when the service needs to manage the key material directly.
-
create
→ const Spec<
CreateRequest, CreateResponse> - Create registers a new device in the system. Returns a unique device ID that should be stored by the client.
-
deRegisterKey
→ const Spec<
DeRegisterKeyRequest, DeRegisterKeyResponse> - DeRegisterKey deregisters a key from a third-party service. This handles cleanup with the external service and removes the associated key metadata from local storage.
-
getById
→ const Spec<
GetByIdRequest, GetByIdResponse> - GetById retrieves one or more devices by their unique identifiers. Supports batch retrieval for efficiency.
-
getBySessionId
→ const Spec<
GetBySessionIdRequest, GetBySessionIdResponse> - GetBySessionId retrieves a device by its active session identifier. Useful for resolving devices from session tokens.
-
getTurnCredentials
→ const Spec<
GetTurnCredentialsRequest, GetTurnCredentialsResponse> - Returns short-lived TURN server credentials for WebRTC media relay. Credentials are generated per-request with a configurable TTL. The server should generate HMAC-based credentials using a shared secret with the TURN server (RFC 5766 long-term credentials).
-
link
→ const Spec<
LinkRequest, LinkResponse> - Link associates a device with a user profile. Required before the device can be used for authenticated operations.
-
listLogs
→ const Spec<
ListLogsRequest, ListLogsResponse> - ListLogs retrieves activity logs for a device. Returns a stream of log entries for the specified device.
-
log
→ const Spec<
LogRequest, LogResponse> - Log creates a new activity log entry for a device. Used for session tracking and security auditing.
- name → const String
- Fully-qualified name of the DeviceService service.
-
notify
→ const Spec<
NotifyRequest, NotifyResponse> - Notify sends a notification to a device using one of its registered keys. The service selects an appropriate key based on key_type (e.g., FCM_TOKEN for push notifications). If key_id is provided, that specific key will be used; otherwise the service selects the best available key.
-
registerKey
→ const Spec<
RegisterKeyRequest, RegisterKeyResponse> - RegisterKey registers a key with a third-party service using an externally-generated key or token. This method handles the integration with the external service and stores metadata about the key, but not the key material itself. Use AddKey to store key material.
-
remove
→ const Spec<
RemoveRequest, RemoveResponse> - Remove deletes a device from the system. This operation cannot be undone.
-
removeKey
→ const Spec<
RemoveKeyRequest, RemoveKeyResponse> - RemoveKey removes one or more keys or tokens from local storage. This does not handle deregistration from third-party services. For that, use DeRegisterKey.
-
search
→ const Spec<
SearchRequest, SearchResponse> - Search finds devices matching specified criteria. Supports filtering by date range, properties, and full-text search.
-
searchKey
→ const Spec<
SearchKeyRequest, SearchKeyResponse> - SearchKey searches for keys or tokens associated with a device.
-
update
→ const Spec<
UpdateRequest, UpdateResponse> - Update modifies an existing device's information. Only the device owner or administrators can update device information.
-
updatePresence
→ const Spec<
UpdatePresenceRequest, UpdatePresenceResponse> - UpdatePresence updates the presence status of a device. Used to track online/offline status and availability for real-time features.