Skip to main content
Push Notifications1 min read

Notification Links: Open a Page When Tapped

Make a tapped push notification open a specific page in your app with the url, route or externalUrl data keys, and which links are allowed.

Overview

When a user taps a notification, your app can open a specific page instead of the home page, for example the product on sale or the article you announced. You set the destination in the notification you send.

Make sure Open the notification's link is on in Integrations › Push notifications › Notification Behavior.

Data keys

Add one of these custom data keys to the notification (in Firebase: Additional options › Custom data; in OneSignal: Additional data):

KeyValueOpens
urlA full URL (https://example.com/sale) or a path (/sale)The page inside your app
routeA path of your website, for example /ordersThe page inside your app
externalUrlA full URLThe page in the phone's browser

If several keys are present, route wins, then url, then externalUrl. A OneSignal Launch URL is treated like url.

For safety, a notification can only open:

Other links, and anything that is not http or https, are ignored and the app opens normally.

Order notifications

For connected stores, order status notifications open the order in the app's native Orders screen automatically. See Shopify and WooCommerce.

Test it

  1. Install a build with push set up and allow notifications.
  2. Send a test notification with a url key pointing to a page of your website.
  3. Tap it with the app closed, and again with the app in the background.

Next steps