示例#1
0
 public void GraphAPICall(string pParams, OnFacebookDelegate pCallback)
 {
     FB.API("/me/?fields=id," + pParams, Facebook.HttpMethod.GET, (FBResult result) => {
         if (pCallback != null)
         {
             pCallback(result);
         }
     });
 }
示例#2
0
 public void GetRanking(OnFacebookDelegate pCallback)
 {
     //FB.API ("/app/scores?fields=score,user.limit(10)", Facebook.HttpMethod.GET, (FBResult result) => {
     FB.API("/" + FB.AppId + "/scores?fields=score,user.limit(10)", Facebook.HttpMethod.GET, (FBResult result) => {
         if (pCallback != null)
         {
             pCallback(result);
         }
     });
 }
    public void GetProfilePicture(OnFacebookDelegate pPictureCallback)
    {
        onGetProfilePictureCallback += pPictureCallback;

        FB.API (FacebookUtil.GetPictureURL ("me", 128, 128), Facebook.HttpMethod.GET, (FBResult result) => {
            if (onGetProfilePictureCallback != null)
                onGetProfilePictureCallback (result);

            onGetProfilePictureCallback = null;
        });
    }
示例#4
0
    public void Login(string pPermissions, OnFacebookDelegate pCallback)
    {
        if (string.IsNullOrEmpty(pPermissions))
        {
            pPermissions = PERMISSION_PUBLIC_PROFILE;
        }

        onLoginCallback += pCallback;

        Debug.Log("Permissions: " + pPermissions);
        FB.Login(pPermissions, OnLoginCallback);
    }
示例#5
0
    public void GetProfilePicture(OnFacebookDelegate pPictureCallback)
    {
        onGetProfilePictureCallback += pPictureCallback;

        FB.API(FacebookUtil.GetPictureURL("me", 128, 128), Facebook.HttpMethod.GET, (FBResult result) => {
            if (onGetProfilePictureCallback != null)
            {
                onGetProfilePictureCallback(result);
            }

            onGetProfilePictureCallback = null;
        });
    }
示例#6
0
    public void SetRankingScore(int pScore, OnFacebookDelegate pCallback)
    {
        var scoreData = new Dictionary <string, string> ();

        scoreData ["score"] = pScore.ToString();

        FB.API("/me/scores", Facebook.HttpMethod.POST, (FBResult result) => {
            //FB.API ("/app/scores", Facebook.HttpMethod.POST, (FBResult result) => {
            if (pCallback != null)
            {
                pCallback(result);
            }
        }, scoreData);
    }
示例#7
0
    void OnLoginCallback(FBResult pResult)
    {
        if (pResult.Error == null)
        {
        }
        else
        {
            Debug.LogError("Login Failed: " + pResult.Error.ToString());
        }

        if (onLoginCallback != null)
        {
            onLoginCallback(pResult);
        }

        onLoginCallback = null;
    }
示例#8
0
    public void GetUserLikes(OnFacebookDelegate pCallback, int pLimit = 50)
    {
        command = new StringBuilder("/me/likes/fields?fields=");

        //Request the name of the pages.
        command.Append("name");

        //Request the pages category.
        command.Append(",category");

        //Number of likes of the page.
        command.Append(",likes");

        //The number of pages returned.
        command.Append("&limit=");
        command.Append(pLimit.ToString());

        FB.API(command.ToString(), Facebook.HttpMethod.GET, (FBResult result) => {
            if (pCallback != null)
            {
                pCallback(result);
            }
        });
    }
 public void GetRanking(OnFacebookDelegate pCallback)
 {
     //FB.API ("/app/scores?fields=score,user.limit(10)", Facebook.HttpMethod.GET, (FBResult result) => {
     FB.API ("/" + FB.AppId + "/scores?fields=score,user.limit(10)", Facebook.HttpMethod.GET, (FBResult result) => {
         if(pCallback != null)
             pCallback(result);
     });
 }
    void OnLoginCallback(FBResult pResult)
    {
        if (pResult.Error == null)
        {
        }
        else
            Debug.LogError ("Login Failed: " + pResult.Error.ToString ());

        if (onLoginCallback != null)
            onLoginCallback (pResult);

        onLoginCallback = null;
    }
    public void SetRankingScore(int pScore, OnFacebookDelegate pCallback)
    {
        var scoreData = new Dictionary<string, string> ();

        scoreData ["score"] = pScore.ToString();

        FB.API ("/me/scores", Facebook.HttpMethod.POST, (FBResult result) => {
        //FB.API ("/app/scores", Facebook.HttpMethod.POST, (FBResult result) => {
            if(pCallback != null)
                pCallback(result);
        }, scoreData);
    }
    public void Login(string pPermissions, OnFacebookDelegate pCallback)
    {
        if (string.IsNullOrEmpty(pPermissions))
            pPermissions = PERMISSION_PUBLIC_PROFILE;

        onLoginCallback += pCallback;

        Debug.Log ("Permissions: " + pPermissions);
        FB.Login(pPermissions, OnLoginCallback);
    }
 public void GraphAPICall(string pParams, OnFacebookDelegate pCallback)
 {
     FB.API ("/me/?fields=id," + pParams, Facebook.HttpMethod.GET, (FBResult result) => {
         if(pCallback != null)
             pCallback(result);
     });
 }
    public void GetUserLikes(OnFacebookDelegate pCallback, int pLimit = 50)
    {
        command = new StringBuilder ("/me/likes/fields?fields=");

        //Request the name of the pages.
        command.Append ("name");

        //Request the pages category.
        command.Append(",category");

        //Number of likes of the page.
        command.Append (",likes");

        //The number of pages returned.
        command.Append ("&limit=");
        command.Append (pLimit.ToString ());

        FB.API (command.ToString(), Facebook.HttpMethod.GET, (FBResult result) =>{
            if(pCallback != null)
            {
                pCallback(result);
            }
        });
    }