tipsi-twitter icon indicating copy to clipboard operation
tipsi-twitter copied to clipboard

Picture url?

Open bisht2ankit opened this issue 7 years ago • 2 comments

Can we get user's profile pic url?

bisht2ankit avatar Nov 02 '17 17:11 bisht2ankit

Hi @ankitbisht143! We need to check it and add if available

isnifer avatar Nov 03 '17 11:11 isnifer

Hi @ankitbisht143 ,

Yes, you can.

Change the lines 118-124 of the TPSTwitterModule.m file as below;

                TWTRAPIClient *client = [TWTRAPIClient clientWithCurrentUser];
                NSURLRequest *request = [client URLRequestWithMethod:@"GET"
                                                                 URL:@"https://api.twitter.com/1.1/account/verify_credentials.json"
                                                          parameters:@{@"include_email": @"true", @"skip_status": @"true"}
                                                               error:nil];
                [client sendTwitterRequest:request completion:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
                    NSError *jsonError;
                    NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
                    NSDictionary *body = @{
                                           @"auth_token": session.authToken,
                                           @"auth_token_secret": session.authTokenSecret,
                                           @"data": json
                                           };
                    resolve(body);
                }];

You can get the same response as https://api.twitter.com/1.1/account/verify_credentials.json.

emnsen avatar Feb 28 '18 12:02 emnsen