I have a Flutter application (Android and iOS) which can handle Android Deep Links & App Links, and iOS Custom URL Schemes & Universal Links.
So the URLs...
company://service/items/{item-id}
https://service.company.com/items/{item-id}
... both open the "Item Detail" page for {item-id}
, as expected and desired.
A backend server for this application sends FCM push notifications, which tell the user when a change has occurred for {item-id}
.
Right now, clicking the push notifications just launches the main page of the app.
I am wondering if it is possible to construct the FCM message in such a way that... it tells the device to open the URL in the default system web browser, which would trigger the existing deep linking functionality I have in place?
I am thinking this would most likely be possible, since I would guess this would be a useful use-case for marketing materials, or actions which need to be completed on a website instead of within the app?
But at the same time, I could imagine that maybe it is not possible to triggering handling of a push notification from another app, than the FCM message receiver?
My rationale behind trying to handle this at the server/FCM broadcast stage, is because I want re-use the existing functional deep linking functionality if possible, with as little changes as possible in the common flutter layer, and avoiding native code as much as possible.
What I'm trying for Android:
{
"notification": {
"title": "Stackoverflow title",
"body": "Click on it to see what happens!",
"click_action": "android.intent.action.VIEW",
"data": "https://service.company.com/items/{item-id}"
},
"data": {
"open_url": "https://service.company.com/items/{item-id}"
},
"android": {
"notification": {
"click_action": "android.intent.action.VIEW",
"data": "https://service.company.com/items/{item-id}"
}
},
"to": "..."
}
... but no luck.
Am I missing something? Or barking up the wrong tree?
Any and all advice and suggestions welcomed :-)