简体   繁体   English

在预定义的时间内禁止特定 firebase firestore 群聊中的用户

[英]Ban a User in a particular firebase firestore group chat for predefined time

I am very new to coding.我对编码很陌生。 but i managed to build a group chat app using a low code platform called flutterflow.但我设法使用名为flutterflow的低代码平台构建了一个群聊应用程序。 i managed to spend significant amount of time on it and was able to build a public group chat app except few functionalities.我设法在它上面花费了大量时间,并且能够构建一个公共群聊应用程序,但功能很少。 I am hoping to find help from here.我希望能从这里得到帮助。 for the following questions.对于以下问题。

  1. I have chat mods appointed on a group level.我在群组级别指定了聊天模块。 like if you create a group, you are a founder and you can assign mods to that perticular group chat.就像如果你创建一个群组,你就是一个创始人,你可以将模组分配给那个特定的群聊。 now i want these mods to be able to ban a user in that particular group chat.现在我希望这些模组能够禁止该特定群聊中的用户。

I have tried created a subcollection in groups called "banned user" and created two feilds.我尝试在名为“禁止用户”的组中创建一个子集合,并创建了两个字段。 one is "banned users" document reference to users.一是“禁止用户”文件对用户的引用。 and another is "banned_till" to record a time stamp until the user gets banned.另一个是“banned_till”,用于记录时间戳,直到用户被禁止。

Problem with this is when i ban a user twice, it creates two documents in the user reference with the same user.问题是当我两次禁止用户时,它会在用户参考中创建两个文档,并使用同一个用户。 and two documents has different "banned_till" times.并且两个文档具有不同的“banned_till”时间。 which one it is supposed to pick?它应该选择哪一个?

i tried to do this and put a conditional visibility to the chat that "if current time is less than or equal to banned_till time" it wont let user type in the textfield to chat.我试图做到这一点,并对聊天设置有条件的可见性,即“如果当前时间小于或等于banned_till 时间”,它不会让用户在文本字段中输入聊天内容。 but this is giving me gray screen.但这给了我灰屏。

I am very new to this.我对此很陌生。 any help would be appreciated.任何帮助,将不胜感激。

there is specific way to do so.有特定的方法可以做到这一点。 you have to set custom logic.你必须设置自定义逻辑。 like save all banned users in a firebase database object with thier max time and procced next.就像将所有被禁止的用户保存在 firebase 数据库 object 中,并设置他们的最大时间,然后进行下一步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用规则禁止 Firebase 实时数据库中的用户? - How can I ban a User in Firebase realtime Database using the rules? 如何从聊天应用程序中删除任何特定的聊天记录 android firebase - How to delete the any particular chats from the chat application android firebase Firebase Firestore Swift,时间戳但服务器时间? - Firebase Firestore Swift, Timestamp but server time? 将 firebase 用户保存到 Firestore 并添加新元素 - saving firebase user to firestore and adding new elements 如何测量云 Function 中 Firebase 中特定代码块的执行时间? - How to measure execution time of a particular block of code in Cloud Function for Firebase? Firebase。条纹。 如何检查付费订阅的特定用户? - Firebase. Stripe. How to check a particular user on paid subscription? firebase firestore 日期时间 sstamp 返回 nil swift - firebase firestore date time sptamp returns nil swift 运行 Cloud Function 将 Firebase 经过身份验证的用户数据存储到 Firestore - Run Cloud Function to store Firebase Auth'ed user data to Firestore 如何使用 Firebase Firestore 在 Futter 中显示用户名和个人资料图片 - How to show user name and profile picture in Futter using Firebase Firestore Android Studio - 中止 Firebase Firestore 文档在时间限制后写入 - Android Studio - Abort Firebase Firestore document write after time limit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM