Esempio n. 1
0
    void MyInfoCallback(FBResult result)
    {
        Debug.Log("MyInfoCallback");

        if (result.Text == null || result.Text == "" || result.Text.Length < 1)
        {
            Debug.Log("MyInfoCallback result Error=" + result.Text);
            return;
        }
        else
        {
            Debug.Log("MyInfoCallback result=" + result.Text);
        }

        var myInfo = JSON.Parse(result.Text);

        //Debug.Log("myInfo="+myInfo);

        g.fbId       = myInfo["id"];
        fbUserName   = myInfo["name"];
        fbUserGender = myInfo["gender"];
        fbUserLink   = myInfo["link"];
        fbUserLocale = myInfo["locale"];

        dbo.InsFbUserInfo(g.fbId, fbUserName, fbUserGender, fbUserLink, fbUserLocale);
        dbo.UptUserFbId(g.fbId);

        //Debug.Log("MyInfoCallback g.facebookEvent=="+g.facebookEvent);

        if (g.facebookEvent == "AppRequst")
        {
            facebookManager.FacebookAppRequest();
        }
        else if (g.facebookEvent == "AppRequstRequestGift")
        {
            facebookManager.FacebookDirectRequest();
        }
        else if (g.facebookEvent == "AppRequstSendGift")
        {
            facebookManager.FacebookDirectRequest();
        }

        FB.API("/me/picture?g&redirect=false&width=128&height=128",
               Facebook.HttpMethod.GET,
               MyPictureCallback);
    }