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

[Android] notification with inline reply #612

Merged
merged 19 commits into from
Dec 12, 2020
Merged

Conversation

lluis-sancho
Copy link
Contributor

@lluis-sancho lluis-sancho commented Dec 15, 2017

Summary

Added an action "ReplyInput" that will show in the notification a button with an inline reply (an input to write in).

Changes Introduced

When configuring the actions from React Native it is required to register an action named "ReplyInput", then schedule the notification with the action parameter as "ReplyInput" and two more parameters:

  • reply_placeholder_text (Text shown in the placeholder of the input)
  • reply_button_text (Action button text)

When the user writes in the input and press the send button, a parameter is added in the bundle to pass it to React Native. To get the text, you will receive it in "action.dataJSON" as "reply_text".

Documentation:

https://developer.android.com/guide/topics/ui/notifiers/notifications.html#inline-reply-action
Updated Readme with a code explanation

@lluis-sancho lluis-sancho changed the title Android notification with inline reply [Android] notification with inline reply Dec 15, 2017
@camumino
Copy link

Great @lluis-sancho I was looking for something like this. Thanks!

@jose-izquierdo
Copy link

This is an outstanding job. Thanks for sharing @lluis-sancho

@ziadalame
Copy link

Any updates on when this pull request will be merged?

@KalebMatthews
Copy link

Can we get a timeline on if/when this will be merged in? I would LOVE this functionality!!

@mkamals
Copy link

mkamals commented Jul 11, 2019

@zo0r : Waiting for this PR to be merged. It's long pending, almost a year now. Would be nice to have this in-line reply feature of push notifications implemented for android.

@lluis-sancho : There seems to be conflict with the branch. It would be good to have it resolved and raise the PR again so that it can be merged.

Thanks.

@vikasg603
Copy link

Any update on this when this pull request is going to merge?
It's quite important when building a chat application.

@MadCoderme
Copy link

please resolve and merge this pr, it has been very important to add this feature since it is nearly 3 years

@lluis-sancho
Copy link
Contributor Author

Updated from master and resolved conflicts.

@vikasg603
Copy link

vikasg603 commented Nov 9, 2020

@lluis-sancho I have seen that you have mentioned the library https://github.com/holmesal/react-native-ios-notification-actions

But the admin has archived it and not maintaining it.

Do you have any other suggestions?

@Dallas62
Copy link
Collaborator

Dallas62 commented Nov 9, 2020

Hi @vikasg603
Take a look to the RNC/push-notification-ios library, actions are now included. (from 1.7.0)

@Dallas62 Dallas62 self-assigned this Nov 9, 2020
@vikasg603
Copy link

Yeah, just checked.

@MadCoderme
Copy link

When will it be merged? This is really a cool feature! Would love to know the time 😃

@Dallas62 Dallas62 changed the base branch from master to dev December 1, 2020 21:22
@Dallas62
Copy link
Collaborator

Dallas62 commented Dec 1, 2020

Hi @lluis-sancho
Unfortunately, I'm not able to run the example project with your PR 😕
Build failed.

react-native-push-notification/example/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:316: error: method abandonPermissions() is already defined in class RNPushNotification
    public void abandonPermissions() {
                ^
/react-native-push-notification/example/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:334: error: method getChannels(Callback) is already defined in class RNPushNotification
    public void getChannels(Callback callback) {
                ^
/react-native-push-notification/example/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:346: error: method channelExists(String,Callback) is already defined in class RNPushNotification
    public void channelExists(String channel_id, Callback callback) {
                ^
/react-native-push-notification/example/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:358: error: method createChannel(ReadableMap,Callback) is already defined in class RNPushNotification
    public void createChannel(ReadableMap channelInfo, Callback callback) {
                ^
/react-native-push-notification/example/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationActions.java:39: error: cannot find symbol
          bundle.putCharSequence("reply_text", remoteInput.getCharSequence(KEY_TEXT_REPLY));
                                                                           ^
  symbol:   variable KEY_TEXT_REPLY
  location: class RNPushNotificationActions
5 errors

@Dallas62 Dallas62 merged commit b343f50 into zo0r:dev Dec 12, 2020
elburu pushed a commit to elburu/react-native-push-notification that referenced this pull request Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants