0
votes

Chat app using XMPP protocol using gmail server

I am using iPhoneXMPP (xmppframework) code provided by code.google.com.

After entering jid, App received number of users who are online/offline.

And if anyone send message it received but cant send.

I am using below code to send msg but no popup chat displayed on my gmail account....

I do not understand what i did wrong....

    NSXMLElement *body = [NSXMLElement elementWithName:@"body"];
    [body setStringValue:textvalue];

    NSXMLElement *message = [NSXMLElement elementWithName:@"message"];
    [message addAttributeWithName:@"type" stringValue:@"chat"];
    [message addAttributeWithName:@"to" stringValue:@"[email protected]"];
    [message addChild:body];

    [[self xmppStream] sendElement:message];

Thanks.....

1
I think you need to provide more information that just this small bit of code. What have you tried to do to debug this? Stepped through the code? Checked that the xmppStream is connected properly? - Nick Bull
code above is absolutely without error. Checkout for xmppStream. is it properly initialized ? - Janak Nirmal

1 Answers

0
votes

The most likely issue is that the receiver does not have the sender on his/her roster. Google Talk requires you to have a presence subscription before sending messages.