In the discussion above, it sounds like your server is getting your list requests very well. Using the installation code, I can not reproduce the problem that you encountered.
You can try turning on logging and see if the protocol log reads what you understand:
#import "DDTTYLogger.h" - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [DDLog addLogger:[DDTTYLogger sharedInstance]]; ...
Or try my test code with your server, and if the problem goes away, get started from there:
#import "AppDelegate.h" #import "XMPPFramework.h" #import "DDTTYLogger.h" #import "DDLog.h" static const int ddLogLevel = LOG_LEVEL_VERBOSE; NSString * const XMPPAuthenticationMethodPlain = @"Plain"; NSString * const XMPPAuthenticationMethodDigestMD5 = @"Digest-MD5"; NSString * const OptionHostName = @"..."; NSUInteger const OptionPort = 5222; BOOL const OptionOldSchoolSSL = NO; NSString * const OptionJID = @"..."; NSString * const OptionAuthenticationMethod = @"Digest-MD5"; NSString * const OptionPassword = @"..."; @interface AppDelegate () <XMPPStreamDelegate, XMPPRosterMemoryStorageDelegate> @property (retain) XMPPStream *xmppStream; @property (retain) XMPPRosterMemoryStorage *xmppRosterMemStorage; @property (retain) XMPPRoster *xmppRoster; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [DDLog addLogger:[DDTTYLogger sharedInstance]]; self.xmppStream = [[XMPPStream alloc] init]; [self.xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()]; self.xmppStream.hostName = OptionHostName; self.xmppStream.hostPort = OptionPort; self.xmppStream.myJID = [XMPPJID jidWithString:OptionJID]; self.xmppRosterMemStorage = [[XMPPRosterMemoryStorage alloc] init]; self.xmppRoster = [[XMPPRoster alloc] initWithRosterStorage:self.xmppRosterMemStorage dispatchQueue:dispatch_get_main_queue()]; [self.xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()]; [self.xmppRoster activate:self.xmppStream]; NSError *error = nil; if (OptionOldSchoolSSL) [self.xmppStream oldSchoolSecureConnect:&error]; else [self.xmppStream connect:&error]; } -(void)applicationWillTerminate:(NSNotification *)notification { [self.xmppStream removeDelegate:self]; [self.xmppStream disconnect]; } -(void)xmppStreamDidConnect:(XMPPStream *)sender { Class authClass = nil; if ([OptionAuthenticationMethod isEqual:XMPPAuthenticationMethodPlain]) authClass = [XMPPPlainAuthentication class]; else if ([OptionAuthenticationMethod isEqual:XMPPAuthenticationMethodDigestMD5]) authClass = [XMPPDigestMD5Authentication class]; else { DDLogWarn(@"Unrecognized auhthentication method '%@', falling back on Plain", OptionAuthenticationMethod); authClass = [XMPPPlainAuthentication class]; } id<XMPPSASLAuthentication> auth = [[authClass alloc] initWithStream:sender password:OptionPassword]; NSError *error = nil; if (![sender authenticate:auth error:&error]) NSLog(@"Error authenticating: %@", error); } -(void)xmppRosterDidPopulate:(XMPPRosterMemoryStorage *)sender { NSLog(@"users: %@", [sender unsortedUsers]); // My subscribed users do print out } @end
It also works if I switch to the roster installation code on -xmppStreamDidAuthenticate , however in this case I need to manually call -fetchRoster .
source share