initialize method Null safety

Future<bool?> initialize(
  1. AndroidInitializationSettings initializationSettings,
  2. {SelectNotificationCallback? onSelectNotification}
)

Initializes the plugin.

Call this method on application before using the plugin further.

To handle when a notification launched an application, use getNotificationAppLaunchDetails.

Implementation

Future<bool?> initialize(
  AndroidInitializationSettings initializationSettings, {
  SelectNotificationCallback? onSelectNotification,
}) async {
  _onSelectNotification = onSelectNotification;
  _channel.setMethodCallHandler(_handleMethod);
  return await _channel.invokeMethod(
      'initialize', initializationSettings.toMap());
}