I have a very simple function that retrieves the facebook user photo.
It used to work great.
After upgrading to Unity 5.3, the callback is not called on iOS. It works on Unity Editor, works on Android, but it does not work on iOS.
I'm using Unity 5.3.1f1 and Facebook Unity SDK 7.3.0
Here is the code:
public class ScoreAvatar : MonoBehaviour {
public string idFacebook;
public Image avatar;
public void UpdateScoreAvatar(){
// get avatar
FB.API ("/"+idFacebook+"/picture", HttpMethod.GET, GetFBAvatar);
Debug.Log("getting avatar FB");
}
// Mostra avatar
void GetFBAvatar(IGraphResult result){
Debug.Log("entered the callback");
if (result.Error != null){
Debug.Log("error with getting user avatar");
return;
}
Debug.Log("user avatar ok");
avatar.sprite = Sprite.Create (result.Texture, new Rect (0, 0, 50, 50), new Vector2 (0, 0));
}
}
On iOS, the photo is not updated, I get the message "getting avatar FB" , but the "entered the callback" message never shows, and I get this message on the XCode debugger:
getting avatar FB
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
ScoreAvatar:UpdateScoreAvatar()
ScoresScrollView:MontaPainelHighScores(List`1)
GameController:ParseHighScores(WWW, WWWForm)
System.Action`2:Invoke(T1, T2)
c__Iterator4:MoveNext()
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
Does anyone know how to fix this?
Thank you very much,
Rogerio
↧