简体   繁体   English

如何检查我发送的请求是否被拒绝?

[英]How to check if the request I've sent was rejected?

How to check if the add friend request I've sent has been rejected in QuickBlox? 如何检查我发送的添加好友请求是否已在QuickBlox中被拒绝?

When I send request to someone he's added to my roster as (Type.none), but when he rejects my request he should be removed from my roster! 当我向某人发送请求时,他以(Type.none)的形式添加到我的名册中,但是当他拒绝我的请求时,应将其从我的名册中删除!

Add/Remove users 添加/删除用户

To add users to the contact list just use the method below: 要将用户添加到联系人列表中,请使用以下方法:

int userID = 56;

if (chatRoster.contains(userID)) {
    try {
        chatRoster.subscribe(userID);
    } catch (SmackException.NotConnectedException e) {

    }
} else {
    try {
        chatRoster.createEntry(userID, null);
    } catch (XMPPException e) {

    } catch (SmackException.NotLoggedInException e) {

    } catch (SmackException.NotConnectedException e) {

    } catch (SmackException.NoResponseException e) {

    }
}

now you need to implement this QBSubscriptionListener 现在您需要实现此QBSubscriptionListener

This user will receive the request to be added to the contact list 该用户将收到要添加到联系人列表的请求

 @Override
public void subscriptionRequested(int userId) {

}

for more info follow its doc link 有关更多信息,请单击其文档链接

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

相关问题 如何检查请求何时发送? - How to check when a request has been sent? 如何检查是否有意图发送的捆绑包? - How can I check if there is a bundle sent with the intent? 如何检查是否可以通过手机发送电子邮件? - How can I check if emails can be sent from my phone? 我如何获取发送到robospice改造的请求字符串URL? - How can I get request string URL that sent to robospice retrofit? 如何查看来自我的Android应用程序的已发送电子邮件? 还是打算完成(无论发送了什么电子邮件)? - How can I check sent emails from my Android application? Or intent upon completion (regardless of email sent)? 如何在OnActivityResult中检查发送的文本? - How to check sent text in OnActivityResult? 如何调试截击请求发送 - How to debug volley request sent 我创建了一个测验,但是我不确定如何使用Parse捕获捕获的按钮以检查答案 - I've created a quiz however I'm not sure how to implement the capturing of the buttons pressed to check against the answer using Parse 膨胀后如何替换视图? - How to replace a view after I've inflated? 如何使用Volley库在登录应用程序中保存用户名和密码进行发送和请求 - How can I save username and password in login application using volley library to sent and request
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM