Click here to Skip to main content
15,907,913 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose I am making a chat app. One user will only be able to chat with another user if he accepts his request. Basically first user sends message to other user. The second user accepts by clicking on the accept button .. and then the friend list is created and they are able to communicate. Can anyone tell the request sending and accepting button code?

What I have tried:

I have made simple chat app where any user can send message to another user through the known mail but without the other permission. I want to make it as facebook where you can send request by entering mail id and if and only if another user clicks accept button then their conversation is possible
Posted
Updated 3-Mar-18 12:12pm

1 solution

So, basically this is a complete article/source code request. You need to modify the way the app works, as it works currently. You need to add the "can send message to" feature. Without looking at your code, it is tough to answer the question, because we have no idea what structure of code you are trying to follow.

Anyways, the solution to this is, you need to have a separate table (if you are having a relational database) and you need to store a value, "is a friend of" relationship in it. Upon sending messages — or even better, before opening the conversation — check whether they are both friends or not. This is more of a coding requirement and less of a supposition. This is why we cannot help much.

Consider trying to search "chat with friends app" in the top right corner, or on Google, remember to add "development tutorial" if searching on Google.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900