7

My Goal: Using Google Firebase Messaging, set up iOS Notification Actions

Resources Referenced:

Question:

I've looked through the above resources, but I still can't figure out how to set the category key for iOS, enabling notification actions. How do I do this?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
smileham
  • 1,430
  • 2
  • 16
  • 28

1 Answers1

9

Figured it out as I was writing the question, and a Google search didn't help me, so hopefully this will help someone else.

I found the answer in this document: FCM HTTP Protocol

In the "Notification payload support" section, the parameter click_action says it "Indicates the action associated with a user click on the notification. Corresponds to category in the APNs payload."

So click_action == aps.category

smileham
  • 1,430
  • 2
  • 16
  • 28
  • 1
    Does this allow you to create action buttons in the notification itself? – Lee Probert Apr 05 '18 at 08:22
  • Hi smileham, i have tried click_action, am setting this property in firebase while pushing notification, but it is not working for ios push notification. notification not showing any action when doing hardpress. – karthik Apr 06 '18 at 12:59
  • @smileham can you please send sample project for "click_action" type notifications. I tried, but I con't understand and I'm not getting any sample code from google. Can you send for me please.... – Naresh Apr 25 '18 at 10:53
  • You save my day!!!! click_action instead click-action as per plugin cordova-plugin-push!!! Thanks @smileham – Simone Campagna Mar 23 '22 at 12:51