我认为标题足够说明问题,但故事如下:
我是XMPPFramework
iOS 新手,我想将我的客户端设置为自动接受它收到的任何订阅请求。以便其他客户端在请求时可以看到该客户端的存在状态。
根据开发人员评论在XMPPRoster.h
文件中,有一个在收到订阅请求时调用的方法:
/**
* Sent when a presence subscription request is received.
* That is, another user has added you to their roster,
* and is requesting permission to receive presence broadcasts that you send.
*
* The entire presence packet is provided for proper extensibility.
* You can use [presence from] to get the JID of the user who sent the request.
*
* The methods acceptPresenceSubscriptionRequestFrom: and rejectPresenceSubscriptionRequestFrom: can
* be used to respond to the request.
**/
- (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence;
但它没有在XMPPRoster.m
. 所以我实现它如下:
- (void)xmppRoster:(XMPPRoster *)sender didReceivePresenceSubscriptionRequest:(XMPPPresence *)presence
{
[self acceptPresenceSubscriptionRequestFrom:[presence from] andAddToRoster:YES];
}
由于我是 XMPPFramework 的新手,我不知道我是否做错了什么,但我仍然无法让该客户出现在其他客户中。
我也看到过类似的主题,例如在 xmpp 客户端 iphone中接受好友请求或Xmpp 接受好友请求,但解决方案似乎甚至不相关!
任何建议都非常感谢。谢谢。