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?
For Apple client apps, you can receive notification and data payloads up to 4000 bytes over the Firebase Cloud Messaging APNs interface. To write your client code in Objective-C or Swift, we recommend that you use the FIRMessaging API. The quickstart example provides sample code for both languages.
For sending FCM notification payload you can use Firebase Cloud Messaging Tool in firebase console. And click on Send your first message. Then enter the Title and body field. If you wish to send it to a particular device then click on Send test message and enter the FCM registration token.
First, you enable push notifications in the Xcode project. Select your project in the project navigator and click on the Capabilities tab. Enable push notifications by turning the switch ON. APNs will respond with a device token identifying your app instance.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With