initNotification static method

Future<bool> initNotification(
  1. GlobalKey<NavigatorState> navigatorKey,
  2. String channelKey,
  3. String channelName,
  4. String channelDes, {
  5. String? channelGroupKey,
  6. bool autoRequestPermission = true,
})

Initialize package's notification config: navigatorKey, channelKey, channelName, channelDes, channelGroupKey params for showing notification purpose.

  • channelKey notification channel key
  • channelName notification channel name
  • channelDes notification channel description
  • channelGroupKey notification channel group key
  • navigatorKey App global navigator key

Implementation

static Future<bool> initNotification(GlobalKey<NavigatorState> navigatorKey,
    String channelKey, String channelName, String channelDes,
    {String? channelGroupKey, bool autoRequestPermission = true}) async {
  WidgetsFlutterBinding.ensureInitialized();
  EHttpInspector.navigatorKey = navigatorKey;
  return await NotificationUtil.init(channelKey, channelName, channelDes,
      channelGroupKey: channelGroupKey,
      autoRequestPermission: autoRequestPermission);
}