0
votes

I am trying to get users profile photo using facebook graph

I thought photos were public and you do not need to have an acces token but when trying I receive A question mark photo.

Trying with my Id http://graph.facebook.com/10150172705012177/picture

returns a blue question mark, by the graph explorer I get access token and I Have the photo

http://graph.facebook.com/10150172705012177/picture?access_token=xxxxxxx

Can I get the profile photo with the fb id without access token???

With: FB.API("10150172705012177/picture", HttpMethod.GET, delegate(IGraphResult photoResult)

and With

public static IEnumerator GetFBProfilePicture() { WWW url = new WWW(System.Uri.EscapeUriString("https: //graph.facebook.com/" + 10150172705012177 + "/picture?type=large")); yield return url; Debug.Log("Completed."); Texture2D texture = new Texture2D(180, 180, TextureFormat.DXT1, false); url.LoadImageIntoTexture(texture); // ...

    var image = Canvas.FindObjectOfType<Image>();
    image.overrideSprite = Sprite.Create(texture, new Rect(0, 0, 8, 8), new Vector2(0.5f, 0.5f)); ;

}

I receive the same, a red question mark

1
Is your app live yet? If not, I don't think it is supposed to work with an app-scoped user id.CBroe
Good point. Additionally, keep in mind Facebook released new version of graph API, which you have to use. You won't be able to release without it. They kept functionality only for already released projects. There is quite a few changes, you can find more here developers.facebook.com/docs/apps/upgradingzhekazheka
If I user FB.api("fbid"/picture) it returns question mark. Using my access token I can see my photo but not another user photo. What I read is that with this call you receive the photo because is public and you do not need an access token. But using the link of graph with my id or another id returns a question blue mark, So I do not know if it is possible to get the profile picture only knowing the Facebook Id.......Roman

1 Answers

0
votes

Resolved!!

I just was getting the id photo and not my Facebook Id

With my facebook Id works :D