requestNotificationPermissions method

  1. @override
void requestNotificationPermissions()
override

Prompts (if need) the user to enable push notifications. After user makes their choice, isDisabledByUser will become either true or false. If accepted, token.value will be set

Implementation

@override
void requestNotificationPermissions() async {
  if (!didInitialize) {
    await Firebase.initializeApp();
    didInitialize = true;
  }

  firebase.requestPermission(
    alert: true,
    announcement: false,
    badge: true,
    carPlay: false,
    criticalAlert: false,
    provisional: false,
    sound: true,
  );
}