[英]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) {
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.