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

How to set up notification actions on iOS #1465

Closed
mathiasmoeller opened this issue Jun 5, 2020 · 9 comments
Closed

How to set up notification actions on iOS #1465

mathiasmoeller opened this issue Jun 5, 2020 · 9 comments
Labels

Comments

@mathiasmoeller
Copy link

mathiasmoeller commented Jun 5, 2020

Is it possible to show notification actions on iOS?
The documentation for notification actions refers to this repo for ios:
https://github.com/holmesal/react-native-ios-notification-actions

Sadly it is not maintained anymore. I found a fork that fixes the build issues.
Nevertheless, it still does not work.
In the documentation of the iOS Push Notification plugin that is used internally to handle iOS notification, it says that

alertAction : The "action" displayed beneath an actionable notification. Defaults to "view". Note that Apple no longer shows this in iOS 10 +

But as far as I know, notification actions are still supported in iOS in general. Is there a way to make this work? Does anyone have a working example of this? Thanks!

My setup is:

  • react-native: 0.59.5
  • react-native-push-notification: github:zo0r/react-native-push-notification#dev (dev branch to get that lastest fixes for andoird notification actions)
  • @react-native-community/push-notification-ios: 1.2.0
  • react-native-ios-notification-actions: nvojnovic/react-native-ios-notification-actions
@Dallas62
Copy link
Collaborator

Dallas62 commented Jun 5, 2020

Hi @mathiasmoeller
Actually there is no implementation in the library for iOS.
I think in the future we should fork push-notification-ios and add missing features, but this will be hard to maintain both iOS and Android.

@mathiasmoeller
Copy link
Author

Yes, I agree this is probably a lot of work 😞.

Maybe remove the iOS part then from the documentation? It is at the very end of the Section about Notification Actions.

@Dallas62
Copy link
Collaborator

Dallas62 commented Jun 6, 2020

I looked on the iOS library, I think we can fork it in the library and unify the interface.
Need some time to dig into it and see what can be done.
Since the iOS library allow different kinds of actions, maybe we can do the same on Android for the next release.

@Dallas62
Copy link
Collaborator

Dallas62 commented Jun 6, 2020

There is a try in PRs, for reply actions, but I don't like how it's implemented.
#612
And this PR #554 introduce this file:
https://github.com/zo0r/react-native-push-notification/pull/554/files#diff-9d57472c44f5636799695075c3ddcc18
Which will allow us more "complex" arguments like:

actions: [{
  id: "yes",
  label: "Yes",
  icon: "..",
  color: ".."
}]

@mathiasmoeller
Copy link
Author

@Dallas62 sorry was on vacation :) Do you think there is any chance these features will find their way into iOS any time soon? 😇

@Dallas62
Copy link
Collaborator

Dallas62 commented Jul 3, 2020

Hi @mathiasmoeller
I will release the next version this week but actions for Android only.
I will look at iOS soon, I just need to find time 😄

@mathiasmoeller
Copy link
Author

I can totally understand :) Just keep me up to date if you are able to work on the iOS part :)

@GuillaumeMunsch
Copy link

Hi :)

Any news on this issue ?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

3 participants