requirePermission method

  1. @override
void requirePermission()
override

Developers should not use this field directly Require push permission via Google

Implementation

@override
void requirePermission() async {
  if(await googleFCMMessaging.isSupported()){
    print("TUIKitPush | Dart | getGooglePermission");
    NotificationSettings settings = await googleFCMMessaging.requestPermission(
      alert: true,
      announcement: true,
      badge: true,
      carPlay: false,
      criticalAlert: false,
      provisional: false,
      sound: true,
    );

    if (settings.authorizationStatus == AuthorizationStatus.authorized) {
      print('User granted permission');
    } else if (settings.authorizationStatus == AuthorizationStatus.provisional) {
      print('User granted provisional permission');
    } else {
      print('User declined or has not accepted permission');
    }
  }
}