enter image description here I want to ask the user this type of promt in both the android and ios ,when the user come inside my app. But im not able to achive it. So if some one know please help me with this. Thank you in advance.
use the permision_handler package like this:
Future<void> requestNotificationPermissions() async {
final PermissionStatus status = await Permission.notification.request();
if (status.isGranted) {
// Notification permissions granted
} else if (status.isDenied) {
// Notification permissions denied
} else if (status.isPermanentlyDenied) {
// Notification permissions permanently denied, open app settings
await openAppSettings();
}
}