I am trying to show a pop up that ask user to grant permission notification. Because as I know.. android api less than 33 always auto on for notification permission. But not in android 33, we need to manually turn on notification permission. So, is there a way to show alert dialog to ask notification permission ? So far I have been using permission_handler but as I know, it doesn't show pop up alert for bluetooth and notification request permission
Solution 1: soul
Brother inside your manifest file you have to add a few lines you will find the build.gradle inside your project root -> android folder-> open this build.gradle file then adds these lines.
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
after this go inside your android-> app-> build.gradle and add these.
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation("androidx.multidex:multidex:2.0.1")
}
and for permission you need to add these lines in your manifest file you will find it inside your android -> app -> src-> main -> manifest open this manifest file and these lines.
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
and you have to add google-services.json inside your android -> src folder.
you can get your google-services.json from firebase official site.
if you need any other help please let me know