开发者

Getting User Details from MGTwitterEngine

开发者 https://www.devze.com 2023-04-08 10:21 出处:网络
I am developing an application which has a Twitter login. I have integrated MGTwitterEngine for that, and everything is working fine.

I am developing an application which has a Twitter login. I have integrated MGTwitterEngine for that, and everything is working fine.

My problem is that when the user logs i开发者_如何学Cn, I need some details -- whatever info is returned by MGTwitterEngine for that logged-in user.

When I had a look in the library docs, I found the below delegate method which might give some user information, but when I log in ,this method never gets called.

- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {

    NSLog(@"User Info Received: %@", userInfo);
}

Can somebody please suggest to me how to get the user's information from MGTwitterEngine or how I should use this method?

_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
    _engine.consumerKey = @"PzkZj9g57ah2bcB58mD4Q";
    _engine.consumerSecret = @"OvogWpara8xybjMUDGcLklOeZSF12xnYHLE37rel2g";

    UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];

    if (controller) 
        [self presentModalViewController: controller animated: YES];
    else {
        tweets = [[NSMutableArray alloc] init];
        [self updateStream:nil];
    }


I found the answer of my question:-

- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username {

    NSLog(@"Authenticated with user %@", username);
    [_engine getUserInformationFor:username];//this line to be added to get userInfo method called
}
0

精彩评论

暂无评论...
验证码 换一张
取 消