Wraps PushReceiver with the configuration and credentials shape used by @eneris/push-receiver. It builds the FirebaseApp internally from the flat config object and maps stored credentials to the new storage layout.
Use it only when migrating an existing integration - new code should use PushReceiver.
const client = new PushReceiverLegacy({
firebase: { projectId, appId, apiKey, messagingSenderId },
credentials, // previously persisted credentials, optional
persistentIds: [], // ids of already received messages
bundleId: undefined, // 'receiver.push.com',
chromeId: undefined, // 'org.chromium.linux',
chromePlatform: undefined, // 1 = Windows, 2 = Darwin, 3 = Linux, 4 = Cros, 5 = iOS
chromeChannel: undefined, // 1 = stable, 2 = beta, 3 = dev, 4 = canary, 5 = unknown
chromeVersion: undefined, // '148.0.7778.271',
timeZone: undefined, // 'Europe/Prague',
vapidKey: undefined,
heartbeatIntervalMs: 5 * 60 * 1000,
maxRetryAttempts: 0, // optional, defaults to 0; non-positive value disables the limit
debug: false,
})- Returns existing credentials and performs a check-in when they are still valid
- Otherwise runs a full GCM + FCM registration and returns the new credentials
- Subscribes to
ON_CREDENTIALS_CHANGE, returns a dispose function - Persist the emitted credentials to reuse the same token after a restart
- Validates the given (or currently configured) credentials against the config
- Toggles debug logging at runtime
config- normalized config with defaults appliedfcmToken- token from the legacy credentials, falling back to the base classpersistentIds- readable and writable list of already processed message ids
All members of PushReceiver are inherited.