ensureInitialized static method

Future<void> ensureInitialized()

Initializes local notifications and attaches FCM foreground listeners.

Call once in main after Firebase.initializeApp. This is the single SDK entry point for foreground push handling — host apps must not call attachFirebaseListeners separately.

For the FCM background isolate, the SDK uses ensureTrayDisplayReady instead (no permission prompt, no FCM listener attachment).

Implementation

static Future<void> ensureInitialized() async {
  await ensureTrayDisplayReady(background: false);
  _attachFirebaseListenersOnce();
  _initialized = true;
}