1,登陆
- (BOOL)connectWithJID:(NSString *)JID password:(NSString *)myPassword;
- (BOOL)anoymousConnection
- (void)xmppStreamDidConnect:(XMPPStream *)sender
- (void)xmppStreamDidDisconnect:(XMPPStream *)sender withError:(NSError *)error
- (void)xmppStreamDidAuthenticate:(XMPPStream *)sender
- (void)xmppStream:(XMPPStream *)sender didNotAuthenticate:(NSXMLElement *)error
- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence *)presence
相关传递数据格式:
<iq id=’2’ type=’get’>
<query xmlns=’jabber:iq:auth’>
<username>Juliet</username>
</query>
</iq>
<presence>
<status>stepped away…</status>
<show>away</show>
</presence>
2,查找
- (void)sendSearchRequest:(NSString *)searchField
- (NSManagedObjectContext *)managedObjectContext_roster
- (NSArray *)fetchRosters
相关传递数据格式:
<iq
type="get"
id="1001"
to="users.jabber.org"
from="romeo@montague.net/orchard">
<query xmlns="jabber:iq:search"/>
</iq>
3,添加
- (void)addRoster
- (void)xmppRoster:(XMPPRoster *)sender didReceiveBuddyRequest:(XMPPPresence *)presence
- (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq
相关传递数据格式:
<iq type="set" id="uniquevalue">
<query xmlns="jabber:iq:roster">
<item jid="romeo@montague.net"
name="Romeo"
subscription="none"
ask="subscribe">
<group>friends</group>
</item>
</query>
</iq>
4,发送信息,收到信息
- (void)sendMessageTo:(XMPPJID *)targetBareID withMessage:(NSString *)newMessage;
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message
相关传递数据格式:
<message to="romeo@montague.net/orchard">
<body>Wherefore art though Romeo?</body>
</message>
a,网络请求,
b,数据返回,