13
Views
3
Comments
[Cloud Messaging Plugin (Firebase)] Problem with Deeplink on Android
cloud-messaging-plugin-firebase
Mobile icon
Forge asset by OutSystems
Application Type
Mobile

question, when I sent a notification to a active application with a deeplink, the app restarts and opens the default home page (Android), on iOS its resuming to the deeplink. I read something like setting the launchmode to singleInstance. Someone already fixed this? 

see for example

- android - Bring a singleInstance Activity Back Using a Notification - Stack Overflow 


when the application is inactive, both Android and iOS apps work fine, clicking the notification opens the app on the deeplink page.

2021-02-17 18-31-05
Alexandre Jacinto
Staff

Hello Matthias,


Thank you for your question.

To better understand the behaviour you're experiencing, could you share a few more details?

  • When you say an active application with a deeplink, you mean the app is running in the background, you get the notification and click on it to open the app, or is the app in the foreground?
  • What version of the Cloud Messaging plugin are you using?
  • What Android version are you using to test?
  • Can you show how you're configuring the deeplink? Are you simply passing the screen name?
  • How are you handling the deeplink once the app opens?
  • What MABS version did you use to generate the app?

I just tested this scenario with our Firebase Sample App that uses the Cloud Messaging Plugin on a Pixel 7 device running Android 16 and it works properly.

We will be waiting for your feedback on this matter.


Best regards,

Alex Jacinto

2024-12-17 14-32-59
Matthias Preuter
 
MVP
  • When you say an active application with a deeplink, you mean the app is running in the background, you get the notification and click on it to open the app, or is the app in the foreground? Active application I ment the application is running in background or foreground. When the app is not running the apps starts and opens the deeplink url
  • What version of the Cloud Messaging plugin are you using?
    • 4.4.0
  • What Android version are you using to test?
    • Pixel 8 with Android 16
  • Can you show how you're configuring the deeplink? Are you simply passing the screen name?
    • I'm simply passing the deeplink com.****.batchdemodev://CordovaBatchDemo/Screen1 
  • How are you handling the deeplink once the app opens? default handling no configuration or 'code' created for it
  • What MABS version did you use to generate the app? MABS 11.0 and 11.2

This app is using Cordova Batch plugin and using Batch.com SDK; notification is sent from Batch.com debug console.


- Application is not active, and notification is sent with deeplink ==> working in iOS and Android, app is opened and opens the deeplink url

- Application is active (in back or foreground) , and notification is sent with deeplink ==> working in iOS opens the deeplink url on Android app is restarting (new instance) and starts on homepage of the app (ignoring the deeplink)

2021-02-17 18-31-05
Alexandre Jacinto
Staff

Thanks for getting back to us!


How are you passing the deeplink in the Notification parameters though? Can you share a screenshot?


You might want to use the "DeepLink" attribute of the "Notification" structure instead (see attached image).

Simply pass the name of the screen you want to navigate to after clicking the notification. Then, your app must handle the "NotificationClicked" event in a client action, and that's where you can check the "ScreenName" input parameter to know what screen you should navigate to.

The Firebase Mobile Sample App available on Forge has this use case implemented in UI Flows -> Common -> Layout -> NotificationsHandlerNotificationClicked, in case you want to have a look.

Best regards,

Alex Jacinto

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.