Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for click_action #73

Open
chemerisuk opened this issue Apr 18, 2019 · 8 comments
Open

Add support for click_action #73

chemerisuk opened this issue Apr 18, 2019 · 8 comments

Comments

@chemerisuk
Copy link
Owner

chemerisuk commented Apr 18, 2019

click_action Optional, string

The action associated with a user click on the notification.

  • iOS: Corresponds to category in the APNs payload.
  • Android: If specified, an activity with a matching intent filter is launched when a user clicks on the notification.

https://developer.apple.com/documentation/usernotifications/declaring_your_actionable_notification_types?language=objc
https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW26

@tmk1991
Copy link

tmk1991 commented May 22, 2019

You could steal what they have in the cordova-plugin-firebase

@andrsdev
Copy link

andrsdev commented Jun 24, 2019

Any updates of this?

@anilwarbhe
Copy link

I am also looking for the same functionality. Any updates on this?

@jayant1993
Copy link

@chemerisuk Any updates on this?

@DokuMe
Copy link

DokuMe commented May 21, 2020

I am not sure if i understood you right but using the onBackgroundMessage should be what you are looking for. This is called, when the user clicks on the notification and the app opens.

@trung-pham
Copy link

I am not sure if i understood you right but using the onBackgroundMessage should be what you are looking for. This is called, when the user clicks on the notification and the app opens.

But it does not fire any callback event when click on the head up notification on android

@asxasdfghjkl
Copy link

I am not sure if i understood you right but using the onBackgroundMessage should be what you are looking for. This is called, when the user clicks on the notification and the app opens.

But it does not fire any callback event when click on the head up notification on android

It should. It does fire onBackgroundMessage callback in my code. If nothing happens after the notification being clicked. One possible reason is you have click_action in your fcm notification payload but doesn't have corresponding intent filter setup in your manifest.xml

@luisVargasGu
Copy link

For those that haven't used Intent filters before (like me) It was a little confusing trying to get it to work but after some trial and error I managed to get it working with this code.

Inside config.xml within the android platform tags:

<!-- notification redirect on notification tap --> <config-file target="AndroidManifest.xml" parent="/manifest/application/activity"> <intent-filter> <action android:name="FCM_PLUGIN_ACTIVITY" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </config-file>

This is what my cloud function looks like:

Screen Shot 2021-07-30 at 10 58 50 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants