onDidReceiveLocalNotificationIos method

void onDidReceiveLocalNotificationIos(
  1. int id,
  2. String? title,
  3. String? body,
  4. String? payload,
)

Implementation

void onDidReceiveLocalNotificationIos(int id, String? title, String? body, String? payload) async
{
  // display a dialog with the notification details, tap ok to go to another page
  logCat( 'NotificationController: IN onDidReceiveLocalNotification Ios' );
  logCat('NotificationController:  id: $id / $title / $body / $payload');
  showDialog(
    context: Get.context!,
    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();

          },
        )
      ],
    ),
  );
}