为什么Facebook个人资料图片请求在iOS上返回null?

时间:2016-02-27 16:40:35

标签: ios facebook unity3d sdk profile-picture

一切都在Android上运行完美,但是当我尝试在iOS设备上获取个人资料图片时。图像返回null。我检查了iOS 9的Facebook文档我有完全相同的文件中显示的plist。当我在控制台中运行应用程序时,我看到“FB已登录”消息,但配置文件图片未显示。有人可以帮忙吗?

void Awake()
{
    instance = this;
    FB.Init(SetInıt, OnHideUnity);
}


public void FbLogin() 
{
    // This is an event trigger when the button pressed.    
    List<string> permissions = new List<string>();
    permissions.Add("public_profile");
    FB.LogInWithReadPermissions(permissions, AuthcallBack);
}
void DealWithFbMenus(bool isLoggedIn)
{
    // This function is called in SetInit func in Awake.
    if(isLoggedIn)
    {
        fbButton.SetActive(false);
        profilePicture.gameObject.SetActive(true);
        loggedInPlayer = true;
        //FB.API("/me?fields=first_name", HttpMethod.GET, DisplayUserName);

        FB.API("/me/picture?type=square&height=128&width=128", HttpMethod.GET, DisplayProfilePic);
    }
    else
        fbButton.SetActive(true);
}

void DisplayProfilePic(IGraphResult result)
{
    if(result.Texture != null)
    {

        profilePicture.sprite = Sprite.Create(result.Texture, new Rect(0,0, 128, 128), new Vector2());

    }

}

1 个答案:

答案 0 :(得分:0)

这是Unity 5.2上的一个错误。它修复了Unity 5.3的新版本