Firebase FCM notifications click_action payload
If your app is in background, Firebase will not trigger onMessageReceived(). Why.....? I have no idea. In this situation, I do not see any point in implementing FirebaseMessagingService.
According to docs, if you want to process background message arrival, you have to send 'click_action' with your message.
But it is not possible if you send message from Firebase console, only via Firebase API.
It means you will have to build your own "console" in order to enable marketing people to use it. So, this makes Firebase console also quite useless!
There is really good, promising, idea behind this new tool, but executed badly.
I suppose we will have to wait for new versions and improvements/fixes!
click_action attribute for web push notification through FCM
I've got the same issue here.
After some trial, as Adrien said, it works but just not documented yet.
And also not included in admin SDK as well. (at least in Python, which I'm using)
Refer to another answer to the same question https://stackoverflow.com/a/52764782/1318878
You can use custom data to do it.
Here's how I create a notification with click action in Python:
notification=messaging.WebpushNotification(
title=<your_title>,
body=<your_body>,
custom_data={"click_action": <your_url>}
)
Related Topics
Android: Allow Portrait and Landscape for Tablets, But Force Portrait on Phone
How to Detect Shake Event with Android
How to Create Directory Automatically on Sd Card
Don't Reload Application When Orientation Changes
Android Activity Over Default Lock Screen
Why Extend the Android Application Class
Image, Saved to Sdcard, Doesn't Appear in Android's Gallery App
How to Create Jar for Android Library Project
Listadapter Not Updating Item in Recyclerview
Switching Between Android Navigation Drawer Image and Up Caret When Using Fragments
How to Style an Android Switch
Problems with Android Fragment Back Stack
Android Locationclient Class Is Deprecated But Used in Documentation
Meaning of Choreographer Messages in Logcat
Webview Load Website When Online, Load Local File When Offline
Android Studio: Gradle - Build Fails -- Execution Failed for Task ':Dexdebug'