K kohlenbach Member Licensed User Oct 9, 2025 #1 I have a b4x app which receives notification data like : Message data: {url=https://google.de, type=message, timestamp=1760012231, title=Test77777123456788, message=Text3333334} I get the data when the app is closed, background or foreground. All good. In my my app I have a webview and I want to show the url from the message data. What I do now is that I save the url in a file and when the app comes in the foreground I load it in the webview. But if more than one notification arrive with different url values my solution always use the last. How can realize that I click on a notifcation, that he use the message data (url) from this notification ?
I have a b4x app which receives notification data like : Message data: {url=https://google.de, type=message, timestamp=1760012231, title=Test77777123456788, message=Text3333334} I get the data when the app is closed, background or foreground. All good. In my my app I have a webview and I want to show the url from the message data. What I do now is that I save the url in a file and when the app comes in the foreground I load it in the webview. But if more than one notification arrive with different url values my solution always use the last. How can realize that I click on a notifcation, that he use the message data (url) from this notification ?
DonManfred Expert Licensed User Longtime User Oct 9, 2025 #2 kohlenbach said: How can realize that I click on a notifcation, that he use the message data (url) from this notification ? Click to expand... You can add extras in the Notification. Make sure to use the stored extras when the app starts. You can create a jsonstring with the data, use the jsonstring as Tag and later get the jsonstring back to get all the values from it. B4X: Copy Sub Activity_Resume Dim in As Intent in = Activity.GetStartingIntent If in.HasExtra("Notification_Tag") Then Log(in.GetExtra("Notification_Tag")) 'Will log the tag End If End Sub Upvote 1
kohlenbach said: How can realize that I click on a notifcation, that he use the message data (url) from this notification ? Click to expand... You can add extras in the Notification. Make sure to use the stored extras when the app starts. You can create a jsonstring with the data, use the jsonstring as Tag and later get the jsonstring back to get all the values from it. B4X: Copy Sub Activity_Resume Dim in As Intent in = Activity.GetStartingIntent If in.HasExtra("Notification_Tag") Then Log(in.GetExtra("Notification_Tag")) 'Will log the tag End If End Sub