Jay T
unread,Mar 10, 2012, 12:00:01 PM3/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to XMPPFramework
I am near completion of my iOS app, but I need some help with parsing
a custom IQ set.
I am using openfire for my xmpp server and XMPPFramework for iOS
client. My app is able to parse message received but not IQ received.
The IQ request does not seem to be triggered in (- (BOOL)xmppStream:
(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq). The IQ seems to just
gets dropped. Am I supposed to register a special IQ listener or IQ
provider in my iOS app or openfire server? I am really lost and would
really appreciate if someone can provide some suggestions.
I currently have my xmlns set as "jabber:client". The IQ gets ignored
and not parsed / received. However, If i use a random namespace I will
receive an error 503 stanza response.
A sample of my IQ request looks like
NSXMLElement *iq = [NSXMLElement elementWithName:@"iq"];
[iq addAttributeWithName:@"type" stringValue:@"set"];
[iq addAttributeWithName:@"to" stringValue:@"test@..."];
[iq addAttributeWithName:@"id" stringValue:@"setRandomProfile"];
NSXMLElement *query = [NSXMLElement elementWithName:@"query"
xmlns:@"jabber:client"];
NSXMLElement *profile = [NSXMLElement elementWithName:@"profile"];
[query addChild:profile];
[profile addChild:[NSXMLElement elementWithName:@"username"
stringValue:username]];
[profile addChild:[NSXMLElement elementWithName:@"name"
stringValue:@"John Doe"]];
[iq addChild:query];
Here is a scenario of what works and what does not:
Working
iOS client A -- ( IQ Set Request ) --> Openfire server
reply: iOS client A <-- (IQ Result) -- Openfire Server
Not working:
iOS client A -- ( Send IQ Set Request ) --> Openfire server
reply: iOS client B <-- (Send IQ Set) -- Openfire Server (Not working,
client B does not receive an IQ Request)
(- (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq was
not triggered)
iOS client A -- ( IQ Set Request ) --> iOS client A (Not working,
client A does not receive IQ)
OR
iOS client A -- ( IQ Set Request ) --> iOS client B (Not working,
client B does not receive IQ)
Xcode debugger indicated Client A sent IQ Request, but neither client
A or B received an IQ Request.