Flutter: Package Alice inspector not showing along with custom foreground notification listener

77 views Asked by At

I use dio in my project and installed Alice package as my network inspector for debugging purposes. I use the native alice.getDioInterceptors() to do so.

In this project, I also use flutter_local_notification plugin and I have my own on click listener for every notification tapped in the app within this code.

_notificationsPlugin.initialize(initializationSettings,
        onDidReceiveNotificationResponse: (payload) async {
       /// ...
       /// my custom open onClicked foreground notification listener goes here
    });

The above's code run when the app enter the home screen. It seems, it overrides the on click listener implementation from Alice itself that is responsible to navigate us to the HTTP inspector screen.

_flutterLocalNotificationsPlugin.initialize(
  initializationSettings,
  onDidReceiveNotificationResponse: _onDidReceiveNotificationResponse,
);
/// .
/// .
/// .
Future<void> _onDidReceiveNotificationResponse(
    NotificationResponse response,
  ) async {
    assert(response.payload != null, "payload can't be null");
    navigateToCallListScreen();
    return;
  }

My question is, how can I make the Alice listener work along with my own custom notification listener? Or, is there any way to differentiate the incoming Alice notification itself so that I can filter it in my custom notification listener?

I tried to tweak the notification payload by setting some parameter of NotificationResponse to null, but I don't think that's a clever idea since some non-Alice notification might have the same properties/behavior.

0

There are 0 answers