I implemented push notification in iOS and android, using APN Apple Push notification and firebase respectively. In iOS first request for notification is from native side (appDelegate/swift code) and if that is denied I’m again requesting for notification permission using permission_handler. But when I denied multiple times the flutter code can’t request for permission but from native code it’s showing the permission dialogue. And also in flutter side it showing PermissionStatus.permanentlyDenied
. And when I am checking settings to enable manually option for notification is not showing in setting.
Permission requesting code is given below,
await Permission.notification.isDenied.then((value) async {
if (value) {
var req = await Permission.notification.request();
print($req);
}
});
swift code is,
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
if granted {
print("Notification permission allowed.")
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
} else {
print("Permission for push notifications denied.")
}
}
expecting a solution for notification option in settings app or permission request dialogue even after permission denied.