Note that there are some explanatory texts on larger screens.

plurals
  1. POXMPPFramework message not sent
    primarykey
    data
    text
    <p>I receive messages from a Google Talk account, they are shown in the Table View in the Ios emulator, but when i send it, it is not shown in the Google Talk client (in another computer). This is the code:</p> <pre><code>-(IBAction)sendchat:(id)sender { General *general = [General sharedManager];//It is a singleton class used to store some values that need to be accesible in the whole application. NSXMLElement *body = [NSXMLElement elementWithName:@"body"]; text=[mensaje text]; NSLog(@"Texto en el body: %@", text); [body setStringValue:text]; NSArray *dest=[general.firstfrom componentsSeparatedByString:@"/"];//in firstfrom is stored the account from wich we receive the first message. This app cannot start a conversation itself, must only answer NSLog(@"Destination trimmed: %@", [dest objectAtIndex:0]);//Here, the destination account shows correctly (without the /xxxx stuff, just name@gmail.com) XMPPMessage *mens=[[XMPPMessage alloc]init]; [mens addAttributeWithName:@"body" stringValue:text]; [mens addAttributeWithName:@"sender" stringValue:general.userlogin]; NSLog(@"text vale: %@", text); NSXMLElement *messagetosend = [NSXMLElement elementWithName:@"message"]; [messagetosend addAttributeWithName:@"type" stringValue:@"chat"]; [messagetosend addAttributeWithName:@"to" stringValue:[dest objectAtIndex:0]]; [messagetosend addChild:body]; NSLog(@"We are sending to: %@", [dest objectAtIndex:0]); [self.xmppStream sendElement:messagetosend]; [self xmppStream:xmppStream didReceiveMessage:mens];//manage the sent message as it was received, to show it in the Table View self.mensaje.text=@""; } </code></pre> <p>As I say, messages are received perfectly, but I cannot send. Ive seen plenty of examples of how to send, and they are like my code. If i debug sender it is shown ok (namesender@gmail.com), and the "to" attribute is ok too (namereceiver@gmail.com). The xmppStrem is set correctly (as far as i know):</p> <pre><code>xmppStream = [[XMPPStream alloc] init]; [xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()]; </code></pre> <p>In ViewDidLoad method.</p> <p>Any help? Thank you.</p> <p>---EDIT---</p> <p>I forgot to say, both accounts know each others and in the Google Talk client, the presence is sent.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload