click on flutter local notification
I use this code :
Future<void> initNotificaiton() async {
AndroidInitializationSettings initializationSettingsAndroid =
const AndroidInitializationSettings(
"flutter_logo",
);
var initializationSettingsIOS = const DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true,
);
final InitializationSettings initializationSettings =
InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
);
await notificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse response) {
log("@@@ test LOG @@@");
log("PayLoad : ${response.payload}");
routingToScreensAccordingToFCMNotificaiton(
notifAction.value, notifBody.value);
},
);
}
notifs Title and body are OK
and I can see notifs on my phone
but "onDidReceiveNotificationResponse" does not execute!!!
how to handle clicking on local notifs!?
you should make that a global function
Обсуждают сегодня