Tap/respond to a message

Hello, 

SfChat documentation and the web  do not have helpful info about about tapping and responding to a given chat message.

1. Is there an event fired when a given chat message is tapped?
2. What is the best practice to respond to a tapped chat message?

Thank you kindly
Alaa

13 Replies 1 reply marked as answer

SS Sivaraman Sivagurunathan Syncfusion Team July 20, 2020 09:00 AM UTC

Hi Alaa, 

Thanks for using Syncfusion controls. 

We have checked your query. Currently we don’t have a support to fire the event when tap the message in SfChat. We  have already logged the bug report for the same. We will implement this feature in any of our upcoming release. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then. 

If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count. 


Regards, 
Sivaraman S 



AS Alaa Serry July 20, 2020 11:19 AM UTC

Thank you for your kind response. Hope to see this feature in the near future. 

In the meantime, is there a work around?

Thanks.


SS Sivaraman Sivagurunathan Syncfusion Team July 21, 2020 06:20 AM UTC

Hi Alaa, 

Thanks for your update. 

You can achieve you requirement by reflect the ChatListView and ItemTapped event. We have prepared the sample based on your requirement, you can download the same from the below link. 

 
public partial class MainPage : ContentPage 
{ 
    public MainPage() 
    { 
        InitializeComponent(); 
        var ChatList = sfChat.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("ChatListView")).GetValue(sfChat) as SfListView; 
        ChatList.ItemTapped += ChatList_ItemTapped; 
    } 
 
    private void ChatList_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e) 
    { 
 
    } 
} 



Regards, 
Sivaraman S 


Marked as answer

JJ John James July 29, 2020 02:58 AM UTC

Thanks Sivaraman for the solution.

Currently the tap command would trigger the whole message item including Avatar and message. I have three questions in regard to the solution.

1. How do we implement the tap command on Avatar image only?
2. How do we implement the tap command on message only?
3. How do we get the message data (like message username, datetime etc.) through the tap command?

Thanks


SS Sivaraman Sivagurunathan Syncfusion Team July 29, 2020 04:55 AM UTC

Hi Alaa, 

Thanks for your update. 

We have checked your query. In that we cannot able to write the separate command for Avatar and Message. But write a command and get the details by reflect the ChatListView and TapCommand. We have prepared the sample based on you requirement and attached the same from the below link. 

Code behind: 

public partial class MainPage : ContentPage 
{ 
    public MainPage() 
    { 
        InitializeComponent(); 
        var ChatList = sfChat.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("ChatListView")).GetValue(sfChat) as SfListView; 
        ChatList.TapCommand = viewModel.TappedCommand; 
    } 
} 

ViewModel code: 

private Command<Object> tappedCommand; 
 
public Command<object> TappedCommand 
{ 
    get { return tappedCommand; } 
    set { tappedCommand = value; } 
} 
 
public GettingStattedViewModel() 
{ 
    TappedCommand = new Command<object>(TappedCommandMethod); 
} 

private void TappedCommandMethod(object obj) 
{ 
    var messageItem = (obj as Syncfusion.ListView.XForms.ItemTappedEventArgs).ItemData; 
    var UserName = (messageItem as TextMessage).Author.Name; 
    var time = (messageItem as TextMessage).DateTime; 
} 




Regards, 
Sivaraman S 



JJ John James July 29, 2020 08:41 AM UTC

Thanks Sivaraman. That's great solution. However, the tap of Time Break can also trigger the command and produce error, Time Break seems having different type than TextMessage.

Could we have two major features in the next release? Those seems very important for Syncfusion Chat to be fully usable.

1. Avatar tap command, to lead to user's profile page
2. chat text selectable for copy

Some other great features, send a recording voice, file attachment etc

Thanks so much for great support always


AS Alaa Serry July 29, 2020 03:53 PM UTC

Thanks Sivaraman.
Your response resolved my issue. - great support!


SS Sivaraman Sivagurunathan Syncfusion Team July 30, 2020 08:13 AM UTC

Hi John/Alaa, 
 
Thanks for the update. 
 
We have checked your query. we have add the TextMessage, Avatar, TimeBreak in ChatListView Items. So if we tap any item in Chat ChatListView ItemTapped will be triggered. And provide solution is workaround. We have consider your requirement in the implementation of the feature. We  have already logged the feature report for the same. We will implement this feature in any of our upcoming release. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.  
 
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.  
 
 
Regards, 
Sivaraman S 



AS Alaa Serry November 28, 2020 12:36 PM UTC


Hello Sivaraman

Just to follow up on my earlier message: 

1. What is the best practice to respond to a tapped chat message?
2. Do you have a special message type that represents a reply to an existing message (e.g. it contains the original message as well as the user reply)

If the answer to Q2 is no, then kindly provide a sample custom chat message that do the trick.

Thank you kindly,
Alaa


GS Gokul Saravanan Syncfusion Team November 30, 2020 04:06 PM UTC

Hi Alaa, 
 
We have checked your requirement “Reply chat messages support in SfChat”. SfChat does not have the support for reply messages. We considered your requirement as feature of “Provide support for reply messages” in SfChat.  
 
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts. 
 
Regards, 
Gokul S 



VA Vassili February 19, 2021 04:23 PM UTC

Hi, are there any news regarding "Reply to a message" functionality (quoting tapped message or a part of it together with the reply)?
This would be a very useful addition to the SfChat framework.
Are there any suggested workarounds if this feature is still not available?

Thanks, Vassili


CS Chandrasekar Sampathkumar Syncfusion Team February 22, 2021 12:06 PM UTC

Hi Vassili, 
Thank you for using Syncfusion products. 
Regarding "Reply to a message" functionality 
We have validated the support to reply message in SfChat control. We are planning to provide support to swipe message in SfChat in 2021 Volume 1 release which is expected to available by end of March 2021. Using Swipe ended event we can implement reply to message in sample level. 
Regards, 
Chandrasekar Sampathkumar 



CS Chandrasekar Sampathkumar Syncfusion Team March 31, 2021 10:55 AM UTC

Hi Vassili, 
We are glad to announce that our Essential Studio 2021 Volume 1 Release v19.1.0.54 is rolled out with “Swipe individual message feature in SfChatand is available for download under the following link. 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
Regards, 
Chandrasekar Sampathkumar 


Loader.
Up arrow icon