React-native-gifted-chat: RFC: Quick Replies

Created on 13 Apr 2018  路  15Comments  路  Source: FaridSafi/react-native-gifted-chat

Not sure if this library can do suggested responses but it would be very helpful for people who build chat bots.

Something like this:
customer-chat

Facebook calls them quick_replies: https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies

Kik calls them suggested_responses
https://dev.kik.com/#/docs/messaging#suggested-response-keyboard

Telegram calls them inline_keyboard https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating

chat-bot pinned

Most helpful comment

@xcarpentier @brunocascio @FaridSafi Looking for input on the API for this feature as I'm planning to work on this feature.

The API I'm thinking of is:

Message:

{
  _id: 1,
  text: 'My message',
  "quickReplies":[
      {
        "contentType":"text",
        "title":"Yes",
        "imageUrl":"http://example.com/img/yes.png"
      },
      {
        "contentType":"text",
        "title":"No",
        "imageUrl":"http://example.com/img/no.png"
      }
    ]
}

Component Props:

onQuickReply (Function) - Callback when sending a quick reply
renderQuickReply (Function) - Custom quick reply

onQuickReply(quickReply) {
   if(quickReply.contentType === "text") {
         // send text message
    } else if (quickReply.contentType === "location") {
        // send location
    } else if (quickReply.contentType === "camera") {
        // open camera then send video / image
    }
    // infinite possibilities 
}
...
<GiftedChat onQuickReply={quickReply => this.onQuickReply(quickReply)}>}

All 15 comments

@xcarpentier @brunocascio @FaridSafi Looking for input on the API for this feature as I'm planning to work on this feature.

The API I'm thinking of is:

Message:

{
  _id: 1,
  text: 'My message',
  "quickReplies":[
      {
        "contentType":"text",
        "title":"Yes",
        "imageUrl":"http://example.com/img/yes.png"
      },
      {
        "contentType":"text",
        "title":"No",
        "imageUrl":"http://example.com/img/no.png"
      }
    ]
}

Component Props:

onQuickReply (Function) - Callback when sending a quick reply
renderQuickReply (Function) - Custom quick reply

onQuickReply(quickReply) {
   if(quickReply.contentType === "text") {
         // send text message
    } else if (quickReply.contentType === "location") {
        // send location
    } else if (quickReply.contentType === "camera") {
        // open camera then send video / image
    }
    // infinite possibilities 
}
...
<GiftedChat onQuickReply={quickReply => this.onQuickReply(quickReply)}>}

@watadarkstar yes yes 馃憤
But nothing block to use renderActions or renderAccessory to do it now I guess...

Or renderMessage

@xcarpentier True I guess you can just use renderMessage to get inline responses, but having an API specific for this would be more convenient.

@watadarkstar Love this idea, how can I help complete this feature?

Hi @pdoggi I ended up doing it in my local project. Do you want to split the work up and write up a PR with the documentation and I can write the code?

@watadarkstar I'm sorry I didn't see your message earlier! I would love to work together on this! The best way to reach me is via email and phone. What's a good way to exchange contact information?

I just sent you a message via your website, so you will have my contact. Let me know how I can help!

any news about the Quick replies
Note: I have downloaded your fork of the library with quick replies and it is not usable yet

@husseinraoouf @pdoggi I wish I had more time for this but feel free to take over my fork and complete the feature 馃槃

@watadarkstar No Problem :smile:
I will Try To Implement this feature as soon as I could any one can feel free to help

hey sorry, I've been super busy as well. 馃槥

any updates regarding this?

Hello @watadarkstar, @husseinraoouf, @pdoggi - I am interested in this very useful initiative. I was wondering if you got a change to progress the development of this item? Thakn you!

@OlivierBessi @grinono Unfortunately, I don't have the bandwidth to work on this but feel free to submit a PR 馃槃

EDIT: You can use this PR as a starting point and make it your own: https://github.com/FaridSafi/react-native-gifted-chat/pull/886/files

can i make application for phone call , messages,block number, etc etc auto response application using react native

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamdurui picture iamdurui  路  3Comments

Hayko1994 picture Hayko1994  路  3Comments

luisar picture luisar  路  3Comments

pentarex picture pentarex  路  3Comments

xcxooxl picture xcxooxl  路  3Comments