requestPermission method

Future<bool> requestPermission()

Shows notification permission request.

Implementation

Future<bool> requestPermission() async {
  bool? result;

  result = defaultTargetPlatform == TargetPlatform.android
      ? await localNotif
          .resolvePlatformSpecificImplementation<
              AndroidFlutterLocalNotificationsPlugin>()
          ?.requestPermission()
      : await localNotif
          .resolvePlatformSpecificImplementation<
              IOSFlutterLocalNotificationsPlugin>()
          ?.requestPermissions(alert: true, badge: true, sound: true);

  return result ?? false;
}