BackgroundSyncOptions
No behavioral description is attached to this declaration. The public signature, parameter and return types, and source location below document its published contract.
Kind: Interface
Package: @ovok/native
Import
import { BackgroundSyncOptions } from '@ovok/native/bt-management';
TypeScript shape
interface BackgroundSyncOptions<T extends DeviceKey = DeviceKey> {
enabled?: boolean;
storage: BackgroundSyncStorage;
onResult: (result: BackgroundSyncResult<T>) => Promise<void>;
onError?: (error: Error) => void;
storageKey?: string;
serviceUUIDs?: readonly string[];
restoreStateIdentifier?: string;
android?: {
foregroundService?: AndroidBluetoothForegroundServiceOptions;
};
notifications?: {
enabled?: boolean;
title?: string;
body?: string | ((result: BackgroundSyncResult<T>) => string);
data?: PushNotificationContent["data"] | ((result: BackgroundSyncResult<T>) => PushNotificationContent["data"]);
};
maxRetries?: number;
retryBackoffMs?: number;
}
This is a type-level export; it has no call parameters.
Public members
| Member | Type | Details |
|---|---|---|
enabled | boolean | Optional. Background delivery is opt-in. |
storage | BackgroundSyncStorage | A durable store that can hold hundreds of KB; createFileQueueStorage is provided for Expo. |
onResult | (result: BackgroundSyncResult<T>): Promise<void> | Called after a result is persisted. Resolve only after the result is accepted. |
onError | (error: Error) => void | Optional. Called when a corrupt stored queue is moved aside and reset. |
storageKey | string | Optional. Storage key used by the queue. |
serviceUUIDs | readonly string[] | Optional. Additional service UUIDs to scan, useful for custom/native device declarations. |
restoreStateIdentifier | string | Optional. iOS restoration identifier. Keep this stable for the lifetime of the app. |
android | { foregroundService?: AndroidBluetoothForegroundServiceOptions; } | Optional. Optional Android foreground-service configuration. When present, the service keeps the JS BLE scan process alive while the app is backgrounded. |
notifications | { enabled?: boolean; title?: string; body?: string | ((result: BackgroundSyncResult<T>) => string); data?: PushNotificationContent["data"] | ((result: BackgroundSyncResult<T>) => PushNotificationContent["data"]); } | Optional. Optional local notification after a queued reading is accepted by onResult. |
maxRetries | number | Optional. Number of delivery attempts before an item is retained as exhausted. |
retryBackoffMs | number | Optional. Base delay for retries. Delays grow exponentially up to the third attempt. |
Learn the workflow
Continue with Bluetooth for the workflow context and examples.