Back to all

Firebase Cloud Messaging – targetUrl ignored when the iOS app is launched from a closed state

Hello,

My app (iOS, bundle ID co.median.ios.krlowro) uses the Firebase Cloud Messaging plugin. Each notification includes a data payload with a full targetUrl, for example:
data: { "nid": "82758", "targetUrl": "https://verifio.ai.studio/?rappel=82758" }

Results of my tests on a real iPhone:

  • App in background: tapping the notification opens the targetUrl correctly.
  • App fully closed (swiped away): tapping the notification opens the app on the initial URL (https://verifio.ai.studio/) instead of the targetUrl.

I added logging in my web app to confirm it:

  • On cold start, window.location is the initial URL, without the targetUrl.
  • window.median is available.
  • My listener median.firebaseMessaging.notificationClicked.addListener(...) is registered, but it is never called.
  • window.median_onesignal_push_opened is never called either.

Questions:

  1. Is targetUrl supposed to be applied when the app is launched from a closed state on iOS? If yes, what setting or build version is required?
  2. If the tap event fires before my JavaScript is ready, is there a way to retrieve the notification that launched the app (an equivalent of getInitialNotification)?
  3. Do I need to rebuild the app to get the latest version of the Firebase Messaging plugin?

Thank you.