For iOS setup of flutter_local_notifications, it need to add the onDidReceiveLocalNotification for IOSInitializationSettings, but the example code is not out of box, how to fix it correctly?
void onDidReceiveLocalNotification(
int id, String title, String body, String payload) async { // How to pass id, title, body and payload
showDialog(
context: context, // How to get the context of dialog?
builder: (BuildContext context) => CupertinoAlertDialog(
title: Text(title),
content: Text(body),
actions: [
CupertinoDialogAction(
isDefaultAction: true,
child: Text('Ok'),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SecondScreen(payload),
),
);
},
)
],
),
);
}