代码之家  ›  专栏  ›  技术社区  ›  kathiria hemendu

关于准则1.2-安全-用户生成内容

  •  0
  • kathiria hemendu  · 技术社区  · 6 年前

    为点

    在应用程序中实现“过滤不良内容的方法”的方法有哪些?

    我的应用程序包含视频上传,视频评论,上线功能

    另外,请建议任何第三方图书馆实施过滤不良内容

    0 回复  |  直到 6 年前
        1
  •  8
  •   dahiya_boy    6 年前

    引用苹果 doc

    像instagram一样,你可以添加一个按钮

    1. 报告攻击性内容和及时回应关注的机制

    在每篇文章中添加报告选项,这样,如果有人针对该文章进行报告,您就可以随时提醒其他用户 . 或者如果有什么骚扰,那么从你的应用程序中删除该帖子。

    enter image description here

    1. 阻止滥用服务的用户的能力

    如果有人持续违反您的应用程序隐私和协议,则暂时挂起帐户。

    添加联系人页面,用户可以根据某些帖子或用户或任何查询(如果有的话)进行报告。

    点1、3、4的示例图像

    enter image description here


    这些是每个社交应用程序都遵循的基本协议,因此您可以从任何应用程序中获取参考。

        2
  •  11
  •   Lance Samaria    5 年前

    建立在 @dahiya_boy excellent answer . 这是我在我的应用程序中的方式,我得到了批准。

    1. 过滤

    您不需要在内容发布之前对其进行过滤。例如,如果有人张贴裸照你不需要人工智能来找出里面的照片之前,它被张贴。有太多不同的事情,可以和不可以被认为是令人反感的人工智能会出错。苹果要你做的是过滤所有被阻止的用户。例如:

    如果userA在tab1中,并且看到了一些他们觉得来自userB的攻击性内容,那么userA可以阻止userB。一旦该块机制就位,userA将不再在tab1中看到来自userB的任何照片,也不会在tab2中看到来自userB的任何消息。

    过滤 这样userA就看不到它们了。这正是苹果所寻求的(我确实是因为使用了这种方法才被批准的)。他们希望它能让阻止某人的用户不再能够看到

    我添加的另一件事是,一旦userA阻止了userB,那么userB就看不到来自userA的任何照片或消息,我不确定这是否是强制性的,但我就是这样做的。基本上是双向的,但这可能并不重要。

    1. 阻止滥用服务的用户的能力

    1. 报告攻击性内容和及时回应关注的机制

    用户生成的内容 例如,一个帖子是一个视频、照片或消息,需要有一个按钮来报告它。你必须让用户知道,它将在24小时内得到审查,如果不合适,它将在这段时间内被删除,你将对发布它的用户采取一些行动(苹果希望你禁止他们进入应用程序,但这最终取决于你)。

    我的审稿人非常仔细。一开始按钮只是说“报告”。当你按下它的时候,一个警告出现了,上面写着“这是不合适的”和一个“是”按钮和一个“取消”按钮。

    1. 已发布的联系信息,以便用户可以轻松联系到您。

    你不需要在你的行动表里有联系我们按钮。

    只要应用程序中的任何地方都有一种用户与你联系的方式就足够了。在“设置”中,我有一个显示“联系我们”的单元格,在“联系我们”视图控制器中,我有公司地址和电子邮件地址。

    这是我用来让我的应用程序通过的4种方法。

    另一方面,实现block功能的最佳方法是使用blockedUsers ref,如果用户向其中添加了某个人,则该用户的userId将位于该ref内。每当发起block的用户位于正在提取消息或帖子等数据的选项卡中时,您需要在blockedUsers ref内进行检查,并从中筛选出任何帖子他们阻止的任何人。

    例如。

    @-blockedUsers
         |
         @----userA_userID
                 |
                 @----userB_userId: true
    

    使用 过滤

    let currentUserID = Auth.auth().currentUser!.uid
    
    Database.database().reference().child("posts")
      .queryOrderedByKey()
      .queryLimited(toLast: 10)
      .observeSingleEvent(of: .value) { (snapshot) in
    
         if !snapshot.exists() { return }
    
         guard let firstChild = snapshot.children.allObjects.first as? DataSnapshot else { return }
    
         for child in snapshot.children.allObjects as! [DataSnapshot] {
    
             if let postDict = child.value as? [String: Any] {
    
                let post = Post(dict: postDict)
                let userBsUserID = post.userId // UserB is really every user who created a post. I just used UserB for demo purposes. A more accurate term would be “otherUsersID” or “posterID”
    
                let blockedUsersRef = Database.database().reference().child("blockedUsers").child(currentUserID)
                blockedUsersRef.observeSingleEvent(of: .value) { (snapshot) in
    
                    // if the currentUser isn't inside this blockedUsersRef then neither is userB
                    if !snapshot.exists() {
    
                         self.dataSource.append(post)
                         self.collectionView.reloadData()
    
                         // *** OR now use this same method to check this currentUserID against userB to make sure it isn't in their blockedUsersRef either before adding their post to the datasource ***
                         return
                    }
    
                    // if the currentUserID does exist then check if userB is inside their blockedUsersRef
                    for child in snapshot.children {
                        let snap = child as! DataSnapshot
                    
                        if snap.key == userBsUserID {
                            // userB IS inside the currentUserId's blockedUsersRef so DON't ADD their post to the datasource
                            return
                        }
                    }
    
                    // userB ISN'T inside the currentUser's blockedUsersRef so ADD the post to the datasource
                    self.dataSource.append(post)
                    self.collectionView.reloadData()
    
                    // *** OR now use this same method to check this currentUserID against userB to make sure it isn't in their blockedUsersRef either before adding their post to the datasource ***
                })
             }
         }
    })
    

    如果您想针对其他用户进行过滤,那么在将post添加到数据源之前,您只需反向执行同样的操作。

    这看起来可能有很多步骤,但是当评审员对其进行测试时 .