C# Unity Facebook SDK不返回名称字段(有时或对于某些用户)

C# Unity Facebook SDK不返回名称字段(有时或对于某些用户),c#,php,android,facebook,unity3d,C#,Php,Android,Facebook,Unity3d,我的游戏现在是测试版,所以我在iOS和Android平台上都有一些用户。当按下“使用Facebook登录”按钮时,授权开始,如果成功,我会尝试获取id、名称、电子邮件,然后将其传递到服务器上的PHP应用程序并存储。我正在使用最新的SDK,目前是v7.9.4 问题出在这里:我正在检查数据库中的用户信息,这时一个新的数据库被授权(FB.LoggedIn返回true)。对于某些用户,数据库中的用户名和电子邮件字段为空,其中id字段不为空且保存不正确 我做了什么:我检查并调试了PHP端,发现name和e

我的游戏现在是测试版,所以我在iOS和Android平台上都有一些用户。当按下“使用Facebook登录”按钮时,授权开始,如果成功,我会尝试获取id、名称、电子邮件,然后将其传递到服务器上的PHP应用程序并存储。我正在使用最新的SDK,目前是v7.9.4

问题出在这里:我正在检查数据库中的用户信息,这时一个新的数据库被授权(FB.LoggedIn返回true)。对于某些用户,数据库中的用户名和电子邮件字段为空,其中id字段不为空且保存不正确

我做了什么:我检查并调试了PHP端,发现name和email的GET参数是空的。所以PHP方面没有什么要做的

我需要一个关于检查什么、尝试什么或如何调试的建议。此外,在Unity方面很难调试,因为我使用自己拥有的facebook帐户和苹果/安卓设备没有问题

以下是与问题相关的C代码:

public void FBlogin()
{
    List<string> permissions = new List<string>();
    permissions.Add ("public_profile,email");

    FB.LogInWithReadPermissions (permissions,AuthCallBack);
}

void AuthCallBack(IResult result)
{
    if(result.Error != null){
        Debug.Log (result.Error);
    }
    else{
        if (FB.IsLoggedIn)
        {
            //Debug.Log("FB is logged in");

            FB.API ("/me?fields=id,name,email",HttpMethod.GET, GotUserInfo);
            FB.API ("/me/picture?type=square&height=100&width=100",HttpMethod.GET, GotUserPicture);
        }
        else
        {
            Debug.Log("FB is not logged in");
        }
    }
}

void GotUserInfo(IResult result)
{
    if(result.Error == null)
    {
        mainMenu.GetComponent<MainMenu> ().UpdateFBName (true,result.ResultDictionary["name"].ToString ());
        fbID = result.ResultDictionary["id"].ToString ();

        string getVariables = "fb_id=" + fbID + "&name=" + result.ResultDictionary ["name"].ToString ()+ "&score=0&email="+result.ResultDictionary ["email"].ToString ();

        StartCoroutine(SendMyDataToServer (domainURL + "/SetUserInfo.php/?"+getVariables));
    }
}
public void FBlogin()
{
列表权限=新建列表();
权限。添加(“公共_配置文件,电子邮件”);
FB.LogInWithReadPermissions(权限、AuthCallBack);
}
void AuthCallBack(IResult结果)
{
if(result.Error!=null){
Debug.Log(result.Error);
}
否则{
如果(FB.IsLoggedIn)
{
//Debug.Log(“FB已登录”);
FB.API(“/me?fields=id,name,email”,HttpMethod.GET,GotUserInfo);
FB.API(“/me/picture?type=square,height=100,width=100”,HttpMethod.GET,GotUserPicture);
}
其他的
{
Debug.Log(“FB未登录”);
}
}
}
void GotUserInfo(IResult结果)
{
if(result.Error==null)
{
mainMenu.GetComponent().UpdateFBName(true,result.ResultDictionary[“name”].ToString());
fbID=result.ResultDictionary[“id”].ToString();
string getVariables=“fb_id=“+fbID+”&name=“+result.ResultDictionary[“name”]”。ToString()+“&score=0&email=“+result.ResultDictionary[“email”]”。ToString();
Start例程(SendMyDataToServer(domainURL+“/SetUserInfo.php/?”+getVariables));
}
}