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.
Tried using permission_handler package but not able to see the permission dialog
2
Answers
You can use this code for permission in flutter.
You also need to configure permission for notification in iOS in xcode by enabling push notification.
void requestNotificationPermission() async {
NotificationSettings settings = await messaging.requestPermission(
alert: true,
announcement: true,
badge: true,
carPlay: true,
criticalAlert: true,
provisional: true,
sound: true,
);
}
add it in any init function it will show the permission Dialog for the notification