Question

I’m trying to convert a numeric twitter ID to a normal username – not random letters – during signup.

I'm using Parse as the backend.

- (IBAction)twitterSignup:(id)sender {


        [PFTwitterUtils logInWithBlock:^(PFUser *user, NSError *error) {
            if (![PFTwitterUtils isLinkedWithUser:user]) {
                [PFTwitterUtils linkUser:user block:^(BOOL succeeded, NSError *error) {
                    if ([PFTwitterUtils isLinkedWithUser:user]) {
                        NSLog(@"User logged in with Twitter!");
                    }
                }];
            }
            if (!user) {
                NSLog(@"The user cancelled the Twitter login.");
                return;
            } else if (user.isNew) {
                NSLog(@"User signed up and logged in with Twitter!");
            } else {
                NSLog(@"User logged in with Twitter!");
Was it helpful?

Solution

To get the screen name:

NSString *twitterScreenName = [PFTwitterUtils twitter].screenName;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top