相关疑难解决方法(0)

如何使用xmpp框架仅列出facebook上的在线用户

我已经在我的应用程序中集成了xmpp并能够在表格视图中列出所有用户,但我只想显示在线用户,然后想要实现该功能以向我的在线朋友发送和接收消息...

请给我一些有用的代码......

这是我的代码,在facebook登录后执行.

    - (void)fbDidLogin
{
    NSLog(@"logged in.....................");
    [appDelegate.facebook requestWithGraphPath:@"me" andDelegate:self]; 

    DDLogVerbose(@"%s accessToken: %@ expirationDate: %@",__PRETTY_FUNCTION__,appDelegate.facebook.accessToken,appDelegate.facebook.expirationDate);
    self.accessToken = appDelegate.facebook.accessToken;

    if (xmppStreamFB) {  
        [xmppStreamFB release];  
        xmppStreamFB = nil;  
    }
    xmppStreamFB = [[XMPPStreamFacebook alloc] init];
    xmpReconnect = [[XMPPReconnect alloc] initWithStream:xmppStreamFB];  

    if (xmppRosterStorage) {  
        [xmppRosterStorage release];  
        xmppRosterStorage = nil;  
    }
    xmppRosterStorage = [[XMPPRosterCoreDataStorage alloc] init];

    if (xmppRoster) {  
        [xmppRoster release];  
        xmppRoster = nil;  
    } 
    xmppRoster = [[XMPPRoster alloc] initWithStream:xmppStreamFB rosterStorage:xmppRosterStorage];

    [xmppStreamFB addDelegate:self];
    [xmppRoster addDelegate:self];
    [xmppRoster setAutoRoster:YES];

    xmppStreamFB.myJID = [XMPPJID jidWithString:[NSString stringWithFormat:@"%@@chat.facebook.com", uid]];

    // …
Run Code Online (Sandbox Code Playgroud)

iphone xmpp facebook-graph-api xmppframework

7
推荐指数
1
解决办法
5770
查看次数

标签 统计

facebook-graph-api ×1

iphone ×1

xmpp ×1

xmppframework ×1