-1
一切工作在Android上完美,但当我尝试获取iOS设备上的个人资料图片。图像返回null。我检查了iOS 9的Facebook文档,我有和文档中显示的完全一样的plist。当我在控制台中运行应用程序时,我看到“FB已登录”消息,但配置文件图片未显示。谁能帮忙?为什么Facebook个人资料图片请求在iOS上返回null?
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());
}
}
为什么不在这里发布代码来展示你所做的事情? – Tapani
我加了我的代码。此代码在电脑上可以正常工作,但不能在iOS上工作。 –
你有什么想法吗? @Tapani –