fcmWebVapidKey property

String get fcmWebVapidKey

The Web Push VAPID public key used to mint an FCM token on web (getToken(vapidKey: …)). Empty ⇒ web token capture is skipped quietly (BEH-26); a non-empty value AUTO-ENABLES web FCM (see useFCM).

Set via --dart-define=FCM_WEB_VAPID_KEY=… or programmatically via fcmWebVapidKeyDefault. Resolved once on first read. Web push also requires the consumer to deploy firebase-messaging-sw.js.

Implementation

static String get fcmWebVapidKey {
  if (_fcmWebVapidKey == null) {
    const envValue = String.fromEnvironment('FCM_WEB_VAPID_KEY');
    _fcmWebVapidKey =
        envValue.isNotEmpty ? envValue : (_fcmWebVapidKeyDefault ?? '');
  }
  return _fcmWebVapidKey!;
}