-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
[FCM] click_action replacement for iOS #211
Comments
Just FYI - I started work on something like this not long ago. The first link you provided has made me change direction a bit. I will be implementing something :-) |
Glad I could be of help! |
Added support for
The first line of the routine is the simplest case - a category with no actions. When the user taps the notification, NOTE: For this to function properly when the app is not running, or is in the background, you need to ensure that ![]() Also, if using FCMSender to send messages from your server, the value of the |
Hi Dave, Great work! Looking forward to trying this out. Just one thing, the way I would need to use it is to build the actions dynamically from a call to the server. Having a handler method with no parameters makes it difficult to do this as we don't know which action was tapped. If it could pass the action ID to the handler method, we could build the actions at runtime, use the same handler for all actions and then send the pressed action id back to the server for any required processing. Hope this makes sense, let me know if not 👍 |
Yes, it made sense. Let me know if the changes I just pushed suit you, which allows adding of actions optionally without a handler, and use |
Yes, this is exactly what I meant, makes it much more flexible! Thanks a lot Dave, will be trying this later today. |
There is currently no way on iOS to implement a custom action if the user clicks on a Firebase notification since the click_action key is unsupported on iOS. From what I've found, it is possible to bypass this by using the category key for iOS instead. By default, the category key is used to display a dialog to perform a quick action instead of opening the application. This way it'll be possible to implement a custom behavior inside Delphi (just as with click_action for Android), or even create and register a UNNotificationCategory (although it's probably not worth the hassle).
References:
Apple docs - Configuring Categories and Actionable Notifications
Firebase docs - Notification payload support
SO - just a confirmation other people have done it
The text was updated successfully, but these errors were encountered: