Skip to content

Push Notification - When click on notification, onNotificationOpenedApp or getInitialNotification not calling issue #80

@AndyDesign999

Description

@AndyDesign999

In the Android platform, messaging().onMessage() is working as expected, but onNotificationOpenedApp and getInitialNotification are not functioning as anticipated. I aim to manage navigation to the chat room screen when the user opens the app by clicking on the notification.

const onNotificationOpenedAppFromBackground = async () => {
    const unsubscribe = messaging().onNotificationOpenedApp(
      async remoteMessage => {
        console.log(
          'App opened from BACKGROUND by tapping notification:',
          JSON.stringify(remoteMessage),
        );
      },
    );
    return unsubscribe;
  };

  const onNotificationOpenedAppFromQuit = async () => {
    const message = await messaging().getInitialNotification();

    if (message) {
      console.log(
        'App opened from QUIT by tapping notification:',
        JSON.stringify(message),
      );
    }
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions