[英]Unity 5.1.1f1 Facebook SDK 6.2.2 Error 400: Bad request on getting player picture on iOS
I got stuck at getting profile picture on iOS devices. 我被困在iOS设备上获取个人资料图片。 It works well on Editor, Android devices, even Facebook graph .
它在Editor,Android设备甚至Facebook graph上都能很好地工作 。 After FB.init() called successfully, i call
FB.init()成功调用后,我调用
string url = Util.GetPictureURL(fID, 128, 128);
FB.API(url, Facebook.HttpMethod.GET, AvatarAPICallback);
Following is the url after debugged: 以下是调试后的网址:
v2.5/626213070847481/picture?g&width=128&height=128&redirect=false V2.5 / 626213070847481 /照片?G&宽度= 128&高度= 128&重定向=假
on iPhone, it returns error 400: bad request. 在iPhone上,它返回错误400:错误的请求。
Any answer is appreciated! 任何答案表示赞赏! Thanks
谢谢
Get the UserID and use WWW to request a user picture. 获取用户ID并使用WWW请求用户图片。
Example to download a sprite: 下载精灵的示例:
private IEnumerator DownloadPicture(string userID){
WWW www= new WWW("http://graph.facebook.com/"+userID+"/picture?width=200&height=200");
yield return www;
if(www.error==null)
userPicture = Sprite.Create ((www.texture as Texture2D), new Rect (new Vector2 (0, 0), new Vector2 (www.texture.width, www.texture.height)), new Vector2 (0.5f, 0.5f));
else
userPicture = defaultPicture;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.