I got stuck at getting profile picture on iOS devices. It works well on Editor, Android devices, even Facebook graph. After FB.init() called successfully, i call
string url = Util.GetPictureURL(fID, 128, 128);
FB.API(url, Facebook.HttpMethod.GET, AvatarAPICallback);
Following is the url after debugged:
v2.5/626213070847481/picture?g&width=128&height=128&redirect=false
on iPhone, it returns error 400: bad request.
Any answer is appreciated! Thanks
Get the UserID and use WWW to request a user picture.
Example to download a sprite:
private IEnumerator DownloadPicture(string userID){
WWW www= new WWW("http://graph.facebook.com/"+userID+"/picture?width=200&height=200");
yield return www;
if(www.error==null)
userPicture = Sprite.Create ((www.texture as Texture2D), new Rect (new Vector2 (0, 0), new Vector2 (www.texture.width, www.texture.height)), new Vector2 (0.5f, 0.5f));
else
userPicture = defaultPicture;
}