How it works
Notifications can include additional data. If you’ve included atargetUrl in the notification data, the app navigates to that URL. If you’ve included custom key-value pairs, it calls your JavaScript handler function with that data.
You configure both of these in the Additional Data section of any notification, whether you’re sending from the OneSignal dashboard or the REST API.
Notification tap decision flow
Handling notification taps (deep linking)
To deep-link a user to a specific page when they tap a notification, addtargetUrl to the Additional Data section of your notification:

Add Additional Data to send to your app
targetUrl is a reserved key. As soon as Median sees it in the payload, it navigates the app to that URL automatically.
targetUrl vs. launch URL
OneSignal has two different URL fields, and they behave very differently:
Always use
targetUrl in Additional Data for deep-linking. The Launch URL field is designed for opening external web pages in a browser-like pop-up; it doesn’t support in-app navigation features, JavaScript Bridge calls, or native plugin interactions.
Sending custom data to JavaScript
Separately from navigation, you can attach any custom key-value pairs to Additional Data and read them in JavaScript once the notification is tapped and the app opens. This is the mechanism to use when the tap needs to trigger app logic rather than (or in addition to) a page change. For example, updating app state, firing an analytics event, or pre-filling a search based on the notification content. Define a handler function on your page. Median calls it automatically when a notification is opened:Combining navigation and data
A single notification tap can both navigate and trigger your handler. IncludetargetUrl alongside your custom keys in Additional Data:
targetUrl first, then calls median_onesignal_push_opened with the full data payload so your page can react after the navigation completes.
Frequently asked questions
Do I need to write code to make targetUrl work?
Do I need to write code to make targetUrl work?
No.
targetUrl is handled natively by Median and the app navigates automatically.Can I use targetUrl and custom data in the same notification?
Can I use targetUrl and custom data in the same notification?
Median navigates to
targetUrl and then calls median_onesignal_push_opened with the complete payload.Why isn't my Launch URL opening inside my app the way I expect?
Why isn't my Launch URL opening inside my app the way I expect?
Launch URL opens in a separate popup browser window without JavaScript Bridge or native plugin access. For in-app navigation, use targetUrl in Additional Data instead.What happens if I use targetUrl in Additional Data?
What happens if I use targetUrl in Additional Data?
targetUrl is a reserved key in Additional Data. Including it automatically triggers in-app URL navigation when the notification is tapped. If you want to conditionally navigate to a URL based on your own JavaScript logic instead, use a different key name (for example, openUrl or deepLink) and handle the navigation yourself inside median_onesignal_push_opened.