一切都在 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());
}
}