[jdev] OpenFire server connection to the XMPP iOS chat client

obaid jawad blueobaid at gmail.com
Tue Apr 17 05:51:17 UTC 2012


Hello, everyone I'm unable to connect to the OpenFire server where as I can
connect to the Gmail, and access the Gtalk users.. Here is the link in
which I'm updating the issue after researching. Please have a look. Thank
you.

http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?pli=1

Here is the text appearance which shows by the above link.

I'm able to connect to the local server, and also the google talk and
display the buddies and chat on the iphone chat client but when I try
to connect to the openfire it doesn't connect

    (void)xmppStreamXMPPStream *)sender didReceivePresenceXMPPPresence
*)presence {

// a buddy went offline/online

NSString *presenceType = [presence type]; // online/offline
NSString *myUsername = [[sender myJID] user];
NSString *presenceFromUser = [[presence from] user];

if (![presenceFromUser isEqualToString:myUsername]) {

if ([presenceType isEqualToString:@"available"]) {

[_chatDelegate newBuddyOnline:[NSString stringWithFormat:@"%@@%@",
presenceFromUser, @"50.18.175.235"]];
} else if ([presenceType isEqualToString:@"unavailable"]) {

[_chatDelegate buddyWentOffline:[NSString stringWithFormat:@"%@@%@",
presenceFromUser, @"50.18.175.235"]];
}
}
}

I was setting the local server as obaid-macbook.local and google talk
as m.google.com in the place of "50.18.175.235" in the above code,
however I'm unable to connect to the openfire server that
50.18.175.235.
      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=66f7d4ec9397c17b&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=66f7d4ec9397c17b&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=66f7d4ec9397c17b&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>







  Jonathan Siao     View profile
<http://groups.google.com/groups/profile?enc_user=_qD5rRMAAAAyGMffuNPi9CG-xBjuyiwlWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 12:13 am

I use openfire and I managed to connect fine.
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_2e09c03ee49f4fb1>
-- 
Regards
Jonathan Siao

Hub King's Cross
34 York Way
London N1 9AB
office: +44(0)2071128338
fax: +44(0)2071128338
mobile: +44(0)7765031393
skype: Jonathan.siao
twitter: http://twitter.com/#!/pakmee<http://www.google.com/url?sa=D&q=http://twitter.com/%23%21/pakmee&usg=AFQjCNGVAd09KYxAD08CNWlBxJ9W8jFIkA>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=2e09c03ee49f4fb1&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=2e09c03ee49f4fb1&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=2e09c03ee49f4fb1&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>

Report spam






  obaid jawad     View profile
<http://groups.google.com/groups/profile?enc_user=NKp8DxMAAAChyxuDXW1w2_-ffkepYOZLWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 8:23 am

I see, that's great to hear, can I know what are the settings that are
required to be done on the server side that should be compatible with the
iOS, and also have you used the "Server name" in the server settings in the
iOS code _chatDelegate buddyWentOffline:[NSString
stringWithFormat:@"%@@%@",presenceFromUser,
@"Server"]]; ?
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_6bd53790f6b30054>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=6bd53790f6b30054&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=6bd53790f6b30054&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=6bd53790f6b30054&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>







  obaid     View profile
<http://groups.google.com/groups/profile?enc_user=NKp8DxMAAAChyxuDXW1w2_-ffkepYOZLWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 9:44 am
 I see, that's great to hear, can I know what are the settings that are
required to be done on the server side that should be compatible with
the
iOS, and also have you used the "Server name" in the server settings
in the
iOS code _chatDelegate buddyWentOffline:[NSString
stringWithFormat:@"%@@%@",presenceFromUser,
@"Servername or IP"]]; ?

On Apr 16, 12:13 am, Jonathan Siao
<jonat...<http://groups.google.com/groups/unlock?_done=/group/xmppframework/browse_thread/thread/72da79b9351abb73%3Fpli%3D1&msg=bb37aafe8d5e0bc9>
@mokaza.com> wrote:
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_bb37aafe8d5e0bc9>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=bb37aafe8d5e0bc9&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=bb37aafe8d5e0bc9&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=bb37aafe8d5e0bc9&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>







  Pralea Danut     View profile
<http://groups.google.com/groups/profile?enc_user=vurF5hUAAAD7BkHGsDzmAc7IfQCpuRjx9h3i3SmjGmAJbX05nZ-8fQ>
 More options Apr 16, 11:47 am

Those are just to display the name for the user in the contacts list.
What you need to do is set the hostName property. Optionally the host port.

[xmppStream setHostName:kHostName];
[xmppStream setHostPort:5222];

where kHostName is a constant string defined earlier. Like

#define kHostName @"XX.XXX.XX.XXX" (replace X with your server's ip)

On Apr 15, 2012, at 1:49 PM, obaid wrote:
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_b3020cfc7dc3a407>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=b3020cfc7dc3a407&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=b3020cfc7dc3a407&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=b3020cfc7dc3a407&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>

Report spam






  obaid jawad     View profile
<http://groups.google.com/groups/profile?enc_user=NKp8DxMAAAChyxuDXW1w2_-ffkepYOZLWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 1:06 pm

Thank you for your valuable response, but yes I tried with this and also
debug it but I'm not able to connect to the server, In other I have
installed one packet tracer to trace whether the packets are sent to the
server IP or not, so I have seen in it that it is getting response it
initates as destination to the server, However I'm not visible to other and
also I'm not able to view my buddy list.

To debug it I have put the breakpoints at
- (void)xmppStreamDidAuthenticate:(XMPPStream *)sender {

    // authentication successful
    [self goOnline];
}

and on

- (void)xmppStream:(XMPPStream *)sender didReceivePresence:(XMPPPresence
*)presence {
    }

but the program doesn't even come to this methods.

I'd like to provide you with my server IP and with the username and
password for one of the Openfire user, and check it in your code whehter it
is able to connect it or not. If you can please help me Thank you so much.

On Mon, Apr 16, 2012 at 11:47 AM, Pralea Danut
<praleada...<http://groups.google.com/groups/unlock?_done=/group/xmppframework/browse_thread/thread/72da79b9351abb73%3Fpli%3D1&msg=90eb8ac8f5ec63ff>
@gmail.com>wrote:
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_90eb8ac8f5ec63ff>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=90eb8ac8f5ec63ff&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=90eb8ac8f5ec63ff&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=90eb8ac8f5ec63ff&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>







  obaid jawad     View profile
<http://groups.google.com/groups/profile?enc_user=NKp8DxMAAAChyxuDXW1w2_-ffkepYOZLWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 1:09 pm

I forgot to mention as I debug it I have also put the breakpoints on this
method and the compiler comes to this method after I press login
- (void)xmppStreamDidConnect:(XMPPStream *)sender {

    // connection to the server successful
    isOpen = YES;
//    NSLog(@"hi");
    NSError *error = nil;
    [[self xmppStream] authenticateWithPassword:password error:&error];
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_ef6dae5a1a218b2e>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=ef6dae5a1a218b2e&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=ef6dae5a1a218b2e&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=ef6dae5a1a218b2e&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>







  obaid jawad     View profile
<http://groups.google.com/groups/profile?enc_user=NKp8DxMAAAChyxuDXW1w2_-ffkepYOZLWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 3:08 pm

Hi, An update I have run wireshard on my mac to trace the data packets are
sent to the server side on not, that is OpenFire server and I see that the
iOS chat client sdk, is able to connect to the Openfire server, but it
could not authenticate the user. Here is the description in the image, It
is the screen shot for it.
http://i41.tinypic.com/344xdfp.png<http://www.google.com/url?sa=D&q=http://i41.tinypic.com/344xdfp.png&usg=AFQjCNFKEinmjG649qfyjZewnHdcXRBGPw>
- Show quoted text
-<http://groups.google.com/group/xmppframework/browse_thread/thread/72da79b9351abb73?hide_quotes=no#msg_8ef35e565466d509>

      Reply<http://groups.google.com/group/xmppframework/post?inreplyto=8ef35e565466d509&reply_to=group&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
     Reply to author<http://groups.google.com/group/xmppframework/post?inreplyto=8ef35e565466d509&reply_to=author&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>
      Forward<http://groups.google.com/group/xmppframework/post?inreplyto=8ef35e565466d509&forward=1&_done=%2Fgroup%2Fxmppframework%2Fbrowse_thread%2Fthread%2F72da79b9351abb73%3Fpli%3D1%26&>







  obaid jawad     View profile
<http://groups.google.com/groups/profile?enc_user=NKp8DxMAAAChyxuDXW1w2_-ffkepYOZLWMj6vob75xS36mXc24h6ww>
 More options Apr 16, 3:47 pm

Update to this issue, I have checked to login with the OSX jabber chat
client from Adium, and when I add account and whenever I tries to login it
as me for to accept the certificate, then only it gives me permission to
get visible, Could that be a problem of certificate?
I have taken the screenshot for this issue, please have a look at this link

http://i39.tinypic.com/feg9z8.png<http://www.google.com/url?sa=D&q=http://i39.tinypic.com/feg9z8.png&usg=AFQjCNGPL0U58odM1UDtb6efBUDVXam6Kg>

Thank you, please help me out to solve this issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20120417/c879541f/attachment-0001.html>


More information about the JDev mailing list