Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add identifer to NotificationResponse.payload so alice's notification can be filtered in notification listener. #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abirajabi
Copy link

This PR adds a string to NotificationResponse.payload that sent to the apps that utilize alice package. This string is useful when we have our own onTapped/onClicked listener for the foreground notification.

You can see the complete issue here.

I propose this implementation so that later I can implement this filtering inside my foreground notification listener.

_notificationsPlugin.initialize(initializationSettings,
        onDidReceiveNotificationResponse: (payload) async {
      if (payload.payload == "alice-inspector" && !kReleaseMode) {
        alice.showInspector();
      } else {
        // my custom notification listener goes here
      }
    });

At first I just want to filter the alice notification by using if (payload.payload.isEmpty && !kReleaseMode) since alice sent an empty string to NotificationResponse.payload. However, later I think that it's a bad idea to do so, since other native may also sent an empty string as payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant