我發送一個智商的要求,但我沒有得到正確的result.The回智商是錯誤XMPP無法獲得名冊的iOS
<error code="403" type="auth"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error>
我的代碼是:
- (void)queryRoster {
NSXMLElement *query = [NSXMLElement elementWithName:@"query" xmlns:@"jabber:iq:roster"];
NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"];
XMPPJID *myJID = self.stream.myJID;
[iq addAttributeWithName:@"from" stringValue:@"[email protected]"];
[iq addAttributeWithName:@"to" stringValue:@"127.0.0.1"];
[iq addAttributeWithName:@"id" stringValue:@"1993"];
[iq addAttributeWithName:@"type" stringValue:@"get"];
[iq addChild:query];
[self.stream sendElement:iq];
}
謝謝,但我使用openfire服務器 –