I'm using the go_router package for routing in Flutter App. And we are using OneSignal for notifications. I'm using this handler when the user tried to open a notification
OneSignal.shared.setNotificationOpenedHandler(
(OSNotificationOpenedResult result) {
OSNotification payload = result.notification;
print('"OneSignal: notification opened: ${result}');
});
I tried solutions from other answers but it's not working. My first question was, where to put this code in the app, Do I need to put it inside main function or here in Material App?
MaterialApp.router(
routerConfig: router,
),
And how to open a specific page in this case? Do I need to implement some listener inside go_router and listen to some state and that state will be updated when the user clicks on the notification, is that solution?