Skip to content

Please update to FCM API v1 without click_action #206

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

Closed
JosefJezek opened this issue Mar 8, 2018 · 3 comments
Closed

Please update to FCM API v1 without click_action #206

JosefJezek opened this issue Mar 8, 2018 · 3 comments
Assignees

Comments

@JosefJezek
Copy link

JosefJezek commented Mar 8, 2018

FCM API v1 has not click_action in notification.
https://firebase.google.com/docs/cloud-messaging/send-message

SDK lib prevents other listeners from receiving the click event. I can not use a listener for notificationclick in SW.
https://github.com/firebase/firebase-js-sdk/blob/master/packages/messaging/src/controllers/sw-controller.ts#L155

How to handle properly click event?

Curl for send message using FCM API v1...

curl -X POST -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" -d '{
"message":{
  "token": "???",
  "data": {
    "badge": "images/badge.png",
    "icon": "images/icon.png",
    "image": "images/image.png"
  },
  "webpush": {
    "headers": {
      "TTL": "3600",
      "Urgency": "high"
    }
  },
  "android": {
    "priority": "high",
    "ttl": "3600s"
  },
  "notification": {
    "title": "TEST",
    "body": "BODY"
  }
}
}' "https://fcm.googleapis.com/v1/projects/$PROJECT_ID/messages:send"
@JosefJezek JosefJezek changed the title Please update to FCM API v1 👀 Please update to FCM API v1 👁️ Mar 8, 2018
@JosefJezek JosefJezek changed the title Please update to FCM API v1 👁️ Please update to FCM API v1 Mar 8, 2018
@JosefJezek JosefJezek changed the title Please update to FCM API v1 Please update to FCM API v1 without click_action Mar 8, 2018
@mmermerkaya mmermerkaya self-assigned this May 14, 2018
@NaorManna
Copy link

@JosefJezek right, we can't listener for notificationclick at SW.
The solution from #102 (comment)
sound good but not work for me...

Thanks for the help!

@kroikie
Copy link
Contributor

kroikie commented Nov 30, 2018

click_action is supported in the web push notification payload.

@kroikie kroikie closed this as completed Nov 30, 2018
@mmermerkaya
Copy link
Contributor

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

4 participants