Promlem检索Facebook个人资料图片

时间:2018-03-27 14:00:36

标签: image facebook url profile

从今天开始,我无法通过网址加载Facebook个人资料图片 http://graph.facebook.com/profile_id/picture?type=large&width=200&height=200

现在它下载带有问号的小图片8x8像素。

不适用于Android和Unity编辑器。 在iOS设备上工作正常。

如何获取个人资料图片?

感谢。

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

当我使用从Firebase获得的个人资料网址时,遇到了同样的问题,我的解决方案是使用来自Facebook的个人资料网址,如下所示:

string imageUri = String.Format("https://graph.facebook.com/{0}/picture?type=large&width=100&height=100", your_id);

IEnumerator LoadImage(string imageUri)
    {

        WWW www = new WWW(imageUri);
        yield return www;

        Debug.Log("Width = " + www.texture.width + "; Height = " + www.texture.height);
        Avata.sprite = Sprite.Create(www.texture, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(0, 0));
    }

它也可以正常工作。希望有帮助。