-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 –