Problem mapping twitter profile image URL

Hi

I’m trying to map my Twitter user’s profile image URL to my user object in Backendless. All the fields map like they should except for the profile_image_url which never returns a result. I am on the latest iOS SDK 3.0.17.

The call I’m doing is the following:

    [backendless.userService easyLoginWithTwitterFieldsMapping:@{@"id":@"username",
                                                                 @"email": @"email",
                                                                 @"name" : @"name",
                                                                 @"profileImageThumbUrl" : @"profile_image_url",
                                                                 @"profileImageUrl" : @"profile_image_url"}
                                                      response:^(id response) {
                                                          NSLog(@"%@", response);
                                                      }
                                                         error:^(Fault *fault) {
                                                             NSLog(@"%@", fault.detail);
                                                         }];

Hi, Niel!

You should put the name of the twitter api field first and it’s Backendless alias second:

[backendless.userService easyLoginWithTwitterFieldsMapping:@{@"id":@"username",
@"email": @"email",
@"name" : @"name",
@"profile_image_url" : @"profileImageThumbUrl",
response:^(id response) {
NSLog(@"%@", response);
}
error:^(Fault *fault) {
NSLog(@"%@", fault.detail);
}];

haha. Thanks! No idea why I didnt try that…

Last question. Is there a way to get different sized profile Images without using the Twitter SDK?

Not that I know of. You might get a better answer from the Twitter support team :slight_smile:

How to get the user email from twitter api in android, in my case it gives an error - “Validation for email property failed. Property value does not match the required pattern.”