如何发送请求并接受请求聊天应用程序? [英] How to make a send request and accept request chat app?

查看:91
本文介绍了如何发送请求并接受请求聊天应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我正在制作聊天应用。一个用户只有在接受了他的请求时才能与另一个用户聊天。基本上第一个用户向其他用户发送消息。第二个用户通过单击接受按钮接受..然后创建好友列表并且他们能够进行通信。任何人都可以告诉请求发送和接受按钮代码吗?



我尝试过:



我已经制作了简单的聊天应用程序,任何用户都可以通过已知邮件向其他用户发送消息,但没有其他权限。我想把它作为facebook,你可以通过输入邮件ID发送请求,当且仅当另一个用户点击接受按钮然后他们的对话才可能

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

推荐答案

所以, 基本上这是一篇完整的文章/源代码请求。您需要修改应用程序的工作方式,因为它目前正常工作。您需要添加可以发送消息到功能。在不查看代码的情况下,很难回答这个问题,因为我们不知道您要遵循的代码结构。



无论如何,解决方法是,你需要一个单独的表(如果你有一个关系数据库),你需要存储一个值,<我>是关系的朋友。在打开对话之前发送消息 - 甚至更好 - 检查他们是否都是朋友。这更多的是编码要求而不是假设。这就是为什么我们无能为力。



考虑尝试在右上角搜索与朋友聊天,或者在Google上,记得添加开发教程 如果在Google上搜索。
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.


这篇关于如何发送请求并接受请求聊天应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆