BackgroundService Domain
Defines events for background web platform features.
Methods
- BackgroundService.clearEvents
- BackgroundService.setRecording
- BackgroundService.startObserving
- BackgroundService.stopObserving
Events
Types
Methods
BackgroundService.setRecording #
Set the recording state for the service.
Parameters
shouldRecord booleanservice Events
BackgroundService.backgroundServiceEventReceived #
Called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.
Parameters
backgroundServiceEvent BackgroundService.recordingStateChanged #
Called when the recording state for the service has been updated.
Parameters
isRecording booleanservice Types
BackgroundService.BackgroundServiceEvent #
Type: object
Properties
timestamp Timestamp of the event (in seconds).
origin stringThe origin this event belongs to.
serviceWorkerRegistrationId The Service Worker ID that initiated the event.
service The Background Service this event belongs to.
eventName stringA description of the event.
instanceId stringAn identifier that groups related events together.
eventMetadata array[ EventMetadata ]A list of event-specific information.
storageKey stringStorage key this event belongs to.
BackgroundService.EventMetadata #
A key-value pair for additional event information to pass along.
Type: object
Properties
key stringvalue stringBackgroundService.ServiceName #
The Background Service that will be associated with the commands/events. Every Background Service operates independently, but they share the same API.
Type: string
Allowed values: backgroundFetch, backgroundSync, pushMessaging, notifications, paymentHandler, periodicBackgroundSync