expo : how to open a particular page on click push notification

i need to open a particular page of the mobile app, when the push notification is clicked from the notification area. i’ve to use expo setup. OS is android.

this is the response object i get while receiving push notification. actionId is the one that will enable to redirect to a specific page? kindly help me out

notification  Object {
  "actionId": null,
  "data": Object {
    "data": "divine1",
  },
  "isMultiple": false,
  "notificationId": 1141166622,
  "origin": "received",
  "remote": true,
  "userText": null,
}
1 Like

I don’t know what actionId does, but you can use the data attribute to send the user to a particular screen.


import { Notifications } from 'expo';

Notifications.addListener(notification => {

  let { toScreen } = notification.data;

  // send user to screen

});

You just have to add toScreen – or whatever else you want – to the data property when you create the notification.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.