android – Flutter permission_handler Doesnt ask for notification

I am utilizing firabase notifications. However earlier than initialize it i need to ask consumer to get permission. However when i utilizing permission_handler its not asking to consumer even i uninstall and reinstall app. How am i able to remedy it ? its my code for ask it :

  void initState() { 

    void getPermissions() async {
        var requestResult = await Permission.notification.request();
        var isPermissionGranted = await Permission.notification.isGranted;
        var isPermissionPermamentlyDenied =
            await Permission.notification.isPermanentlyDenied;

       //Its giving logs immediatly. Would not ask for permission.
        log("requestResult $requestResult");
        log("isPermissionGranted $isPermissionGranted");
        log("isPermissionPermamentlyDenied $isPermissionPermamentlyDenied");

Leave a Reply

Your email address will not be published.