Skip to main content

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​

MemberTypeDetails
enabledbooleanOptional. Background delivery is opt-in.
storageBackgroundSyncStorageA 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) => voidOptional. Called when a corrupt stored queue is moved aside and reset.
storageKeystringOptional. Storage key used by the queue.
serviceUUIDsreadonly string[]Optional. Additional service UUIDs to scan, useful for custom/native device declarations.
restoreStateIdentifierstringOptional. 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.
maxRetriesnumberOptional. Number of delivery attempts before an item is retained as exhausted.
retryBackoffMsnumberOptional. Base delay for retries. Delays grow exponentially up to the third attempt.

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.