Different navigation for push notifications sent from Messages vs API

When I send a push notification to a device from the message center and then click on the notification on my Android device, it opens the app to the default page, which is the functionality I'm going for.

However, when I send a push notification via the API and then click on the notification on my Android device, it opens a screen with the title of the notification in a black bar with a left arrow in it at the top, and then a white area below that with the text of the notification displayed at the top. When I tap the left arrow in the black bar, it takes me to the screen I want to be on.

Here is my payload; what can I do to make tapping the notification open the app to the default app screen?

    const payload = {
        audience: {
            channel: channelId,
            device_type: device.toLowerCase()
        },
        notification: {
           alert: pushNotificationToSend.body          
        },
        options: {
            expiry: pushNotificationToSend.expiry
        },
        message: {
           title: pushNotificationToSend.title,
           body: pushNotificationToSend.body,
           content_type: "text/html",
        },
        in_app: {
           alert: pushNotificationToSend.body,
           display_type: "banner",
           expiry: pushNotificationToSend.expiry,
           display: {
              position: "top"
           }
        },
        device_types: [ device.toLowerCase() ]       
     };

FYI the app is a Meteor app, built for Android. It uses ostrio:flow-router-extra for routing. The default route (the one I want to open) is /student/dashboard/.

I understand that for deep linking there's some configuration and potentially writing of code, but this works w/o any of that for messages sent from the message center so I don't want to reinvent the wheel for something that already works.

Any help is appreciated!

Didn't find what you were looking for?

New post

Comments

2 comments

  • GoPromotional However, when I send a push notification via the API and then click on the notification on my Android device, it opens a screen with the title of the notification in a black bar with a left arrow in it at the top, and then a white area below that with the text of the notification displayed at the top. When I tap the left arrow in the black bar, it takes me to the screen I want to be on.

    Comment actions Permalink
    0
  • Emergency locksmith near me services provide immediate assistance, while managing different navigation for push notifications sent from Messages versus an API requires specific handling. Notifications from Messages might involve simpler, more direct navigation based on the user's message content. In contrast, API-based notifications often require more customized routing, integrating data and context for more complex actions. Proper handling ensures a seamless user experience, directing users to relevant screens depending on the source.

    Comment actions Permalink
    0

Please sign in to leave a comment.