CrossGeeks / FacebookClientPlugin

Facebook Client Plugin for Xamarin iOS and Android
MIT License
106 stars 32 forks source link

Can not get user image in larger size #8

Closed wanderson-ra closed 6 years ago

wanderson-ra commented 6 years ago

Can not obey the full size image. The "picture.type (large)" parameter returns empty. Only the small image with the "picture" parameter is returned.

TimotejRybar commented 6 years ago

Hi, do you mean profile picture? if so then you can adjust height (autoscale-wise) by adding parameter

https://graph.facebook.com/{app-scoped-user-id}/picture?height=640

Let me know if i misunderstood your issue please.

wanderson-ra commented 6 years ago

The following code does not return an image URL:

var profileFacebookDict = await _facebookClient.RequestUserDataAsync (                  new [] {"picture? height = 640", "email", "first_name", "last_name", "birthday"                  new [] {"email", "user_birthday"});

How do I return the URL of the full size image?

TimotejRybar commented 6 years ago

Well i'm not quite sure if you can set parameters after question mark in that string array.

But here is what you can do. If you just want profile picture URL of required app-user-id you can request id too in your Request and then use this api call to retrieve either json or redirect to jpg profile picture of your desired width/height ratio

https://graph.facebook.com/123456789}/picture?height=640

You can also use call below to retrieve json array with picture path instead of redirected jpg

https://graph.facebook.com/123456789/picture?height=640&json=true

rdelrosario commented 6 years ago

The suggestion from @TimotejRybar might be the simpler way to do it.

If you want to use the plugin can do it this way:

 await CrossFacebookClient.Current.QueryDataAsync("{user-id}/picture?height=640&json=true", new string[]{ "public_profile"});

or for the current user:

 await CrossFacebookClient.Current.QueryDataAsync("me/picture?height=640&json=true", new string[]{ "public_profile"});