Open bintu1234 opened 8 years ago
Check your SSL certificate
@mouli1102 i didn't use any ssl certificate.
Use this funcation before connect
- (void)setupStream
{
NSAssert(_xmppStream == nil, @"Method setupStream invoked multiple times");
// Setup xmpp stream
_xmppStream = [[XMPPStream alloc] init];
#if !TARGET_IPHONE_SIMULATOR
{
_xmppStream.enableBackgroundingOnSocket = YES;
}
#endif
// Setup reconnect
_xmppReconnect = [[XMPPReconnect alloc] init];
// Setup roster
_xmppRosterStorage = [[XMPPRosterCoreDataStorage alloc] init];
_xmppRoster = [[XMPPRoster alloc] initWithRosterStorage: _xmppRosterStorage];
_xmppRoster.autoFetchRoster = YES;
_xmppRoster.autoAcceptKnownPresenceSubscriptionRequests = YES;
// Setup vCard support
_xmppvCardStorage = [XMPPvCardCoreDataStorage sharedInstance];
_xmppvCardTempModule = [[XMPPvCardTempModule alloc] initWithvCardStorage:_xmppvCardStorage];
_xmppvCardAvatarModule = [[XMPPvCardAvatarModule alloc] initWithvCardTempModule:_xmppvCardTempModule];
_xmppCapabilitiesStorage = [XMPPCapabilitiesCoreDataStorage sharedInstance];
_xmppCapabilities = [[XMPPCapabilities alloc] initWithCapabilitiesStorage:_xmppCapabilitiesStorage];
_xmppCapabilities.autoFetchHashedCapabilities = YES;
_xmppCapabilities.autoFetchNonHashedCapabilities = NO;
[_xmppRoster activate:_xmppStream];
[_xmppvCardTempModule activate:_xmppStream];
[_xmppvCardAvatarModule activate:_xmppStream];
[_xmppCapabilities activate:_xmppStream];
[_xmppStream setHostName:@"host.credencys.net"];
[_xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
[_xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()];
_allowSelfSignedCertificates = NO;
_allowSSLHostNameMismatch = NO;
}
@bintu1234 Check your JID and password.
Thanks for the replay suppose my password was changed in openfire server in that case.
Hi I am working with the xmpp Framework. while I am login i am getting below log
SEND:
2016-04-14 11:35:08:592 [1731:650f] RECV:
2016-04-14 11:35:08:593 [1731:520f] RECV: PLAIN ANONYMOUS SCRAM-SHA-1 CRAM-MD5 DIGEST-MD5 zlib /stream:features
RECV:PLAIN ANONYMOUS SCRAM-SHA-1 CRAM-MD5 DIGEST-MD5 zlib /stream:features
RECV:PLAIN ANONYMOUS SCRAM-SHA-1 CRAM-MD5 DIGEST-MD5 zlib /stream:features
2016-04-14 11:41:42:545 [1731:622f] RECV:
2016-04-14 11:41:43:177 [1731:622f] RECV:
2016-04-14 11:41:47:547 [1731:607] SEND: biwsbj05NTczNjM1MjY0LHI9REMzRkY3RDQtNEYxNy00RkVBLUE1OTktMjA3QTE5REJGQTNE
2016-04-14 11:41:47:860 [1731:180b] RECV:
if (![xmppStream isDisconnected]) { return YES; } myJID =[NSString stringWithFormat:@"%@@172-31-21-148",[[NSUserDefaults standardUserDefaults] stringForKey:@"userNameJID"]];
NSString *myPassword =@"123456";
// If you don't want to use the Settings view to set the JID, // uncomment the section below to hard code a JID and password. // // myJID = @"user@gmail.com/xmppframework"; // myPassword = @"";
if (myJID == nil || password1 == nil) { return NO; }
[xmppStream setMyJID:[XMPPJID jidWithString:myJID]]; password = myPassword;
NSError *error = nil;
if (![xmppStream connectWithTimeout:XMPPStreamTimeoutNone error:&error]) {
}
return YES;