Configuration
All configuration options for the Abrova Push SDK — apiKey, usePushKit, showServiceNotification, showNotificationInForeground, autoConnect, appGroup, autoRefresh, log levels. Web SDK options for service worker.
All available configuration options for the AbrovaPush SDK.
Configuration Options#
| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | required | Your API key from dashboard |
| notificationIcon | string | null | Android: Resource name of the small notification icon |
| usePushKit | boolean | true (Flutter, React Native), false (native iOS) | iOS: Enable PushKit VoIP pushes (calling apps) |
| showServiceNotification | boolean | true | Android: Show foreground service notification |
| showNotificationInForeground | boolean | true | Show notifications while the app is in foreground (native iOS default: false) |
| autoConnect | boolean | true | iOS: Connect when the app enters foreground |
| appGroup | string | null | iOS: App Group shared with a Notification Service Extension, for background delivery confirmation |
| autoRefresh | boolean | true | All SDKs (Android, iOS, Flutter, React Native, Web): silently refresh a registered device on launch, at most once every 24h or sooner when the app version, SDK version, push token or user changed. Never prompts for permission |
Call register() on every app launch. It keeps the device's token, app version and last-seen time current on the server. Log verbosity is set at runtime with setLogLevel() (see below).
Full Configuration Example#
await AbrovaPush.init(AbrovaPushConfig( // Required - only apiKey needed, server config is auto-fetched apiKey: 'ab_live_your_api_key', // iOS Options usePushKit: false, // Enable only for apps with calling features appGroup: 'group.com.yourcompany.yourapp', // Android Options notificationIcon: 'ic_notification', showServiceNotification: true, // Optional showNotificationInForeground: true, autoConnect: true, ));
Log Levels#
| Level | Description |
|---|---|
| none | No logging output |
| error | Only error messages |
| warning | Errors and warnings |
| info | Errors, warnings, and info messages |
| debug | All messages (recommended for development) |
| verbose | Everything including stack traces |
import 'package:flutter/foundation.dart';
// Set log level based on build mode
if (kReleaseMode) {
await AbrovaPush.setLogLevel(AbrovaPushLogLevel.error);
} else {
await AbrovaPush.setLogLevel(AbrovaPushLogLevel.debug);
}Web#
The Web SDK requires only apiKey. Connection configuration is automatically fetched from the server; the realtime connection runs over TLS on port 443.
| Option | Type | Default | Description |
|---|---|---|---|
| apiKey | string | required | Your API key from dashboard |
| serviceWorkerPath | string | /abrova-push-sw.js | Path to service worker file |
| autoRegisterServiceWorker | boolean | true | Auto-register service worker on init |
| maxReconnectAttempts | number | 0 | Max reconnection attempts (0 = keep retrying, backing off up to 60 s) |
| logLevel | AbrovaPushLogLevel | ERROR | Logging verbosity (NONE, ERROR, WARNING, INFO, DEBUG, VERBOSE) |
| appVersion | string | - | Your web app version, shown per device and usable as a segment filter |
| autoRefresh | boolean | true | Silently re-register a browser that registered before, at most once every 24h or sooner when something changed. Never prompts |
Web SDK Full Example
import AbrovaPush, { AbrovaPushLogLevel } from '@abrova/push-web';
const abrovaPush = new AbrovaPush({
// Required
apiKey: 'ab_live_your_api_key',
// Optional - defaults shown
serviceWorkerPath: '/abrova-push-sw.js',
autoRegisterServiceWorker: true,
maxReconnectAttempts: 0,
logLevel: AbrovaPushLogLevel.ERROR,
appVersion: '2.0.0',
autoRefresh: true,
});
// Change log level at runtime
abrovaPush.setLogLevel(AbrovaPushLogLevel.ERROR);The Web SDK automatically fetches connection credentials and VAPID keys from the server using your API key. You don't need to configure these manually.