getAppLifeCycle method

  1. @override
Future<NotificationLifeCycle> getAppLifeCycle()
override

Returns the current state of the app lifecycle in regards to notifications.

The returned value is an enumerator of type NotificationLifeCycle. The possible values are:

This method returns a Future that resolves to a NotificationLifeCycle value representing the current state of the app in regards to notifications.

Implementation

@override
Future<NotificationLifeCycle> getAppLifeCycle() async {
  final String? lifeCycleRaw =
      await methodChannel.invokeMethod(CHANNEL_METHOD_GET_APP_LIFE_CYCLE);
  return NotificationLifeCycle.values
      .firstWhere((e) => e.name == lifeCycleRaw);
}