Aditya Eka Prabowo wrote:
Hi George, thank you for your further explanation.
Yes, I have followed the method that you are using from the video tutorial. But unfortunately, that didn't work for our mobile app. After clicking the push notification it won't redirect to the specific screen I defined. That's why I'm using OpenNotification function to open the deeplink parameter.

We are using ADAL plugin (office 365) for login authentication. Are you using Outsystems based plugin in your mobile app?
Yes, I am using several OutSystems based plugins in my mobile app - Camera Plugin and Barcode plugin, among others.
I respectfully submit that your attempt to workaround the problem of not being able to get your deeplink working by using the "OpenNotification" client action is taking you down a blind alley. I don't believe OpenNotification is meant to be used in the way that you are using it.
The description I found for this action states: "Checks for unopened notification and retrieves the notification data. Best if used on a 'HomeRedirect' screen in order to check for notifications and immediately process the deep link." If your user opens the notification, how would OpenNotification see it anymore, because it is looking for unopened notifications?
Or, maybe I am not understanding how you want this to work. Your initial post stated that:
1. "...when the app is in the foreground or background it failed to deliver the deeplink parameter."
I am of the opinion that your code in OnRender is interfering with the processing of the deeplink. It is not necessary to have this type of code or logic if all you want to do is have your app open and navigate to a particular screen, specified in the deeplink, when the user opens the operating system notification.
Build a simple test mobile app in OutSystems with two screens, and send a notification with deeplink to open one or the other screen. As long as you call InitCloudMessaging somewhere when you login, you shouldn't need any additional code. Get this working first in this test app, then figure out what's different with your actual app you want to get working.
2. "After clicking the push notification message, it only redirect to the app home screen not the specific screen that I wanted."
This does not make sense to me. If I purposely provide a screen name that does not exist in my mobile app, when I open the deeplink-enabled notification, I get an error screen stating that the specified screen name does not exist, and a link to re-load the mobile application, which then takes me to the app's home screen. Is this what you are seeing? Then the name of the screen you're providing in your deeplink is incorrect.
Maybe you have an older version of the FirebaseMobile plugin installed in your environment? If so, try upgrading to the latest version.
3. " It only works when the mobile app is totally closed or never opened".
I think this has to do with when and how your OnRender code is running. From the OutSystems documentation: "The On Render event handler runs after each time the Screen or Block is rendered, i.e. whenever the Screen or Block is opened (right after the On Ready event handler execution) and after any change of the data of the Screen. " https://success.outsystems.com/Documentation/11/Developing_an_Application/Implement_Application_Logic/Screen_and_Block_Lifecycle_Events
I don't think this is what your case calls for, but maybe I am not understanding what you want to happen. Even so, your use of OpenNotification to try to access notification data from a notification that was just opened seems to me to be the main source of error here.