0

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 in, 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];
    }
Gypsa
  • 11,230
  • 6
  • 44
  • 82
  • Have you actually set a delegate for the engine? – jscs Sep 27 '11 at 05:58
  • @Josh yes everything is working fine.I have set it but not getting this method gets called. – Gypsa Sep 27 '11 at 06:02
  • 1
    And you're calling `getUserInformationFor:`? And not getting anything in `requestFailed:withError:`? It might help to post a snippet that reproduces the problem. – jscs Sep 27 '11 at 06:12

1 Answers1

1

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
}
Gypsa
  • 11,230
  • 6
  • 44
  • 82
  • I guess [my comment](http://stackoverflow.com/questions/7564732/getting-user-details-from-mgtwitterengine) helped you, then? – jscs Sep 27 '11 at 20:41
  • @Josh Caswell yes it give me some way to do the exact functionality.Thanks a lot. – Gypsa Sep 28 '11 at 03:49