How to post a score from my unity game to facebook?

I am trying to write a code that that can post the best score in my unity game to Facebook. Everything seems to work but nothing appears on my facebook page. My question is that am I missing something here to make it post to Facebook?

using UnityEngine;
using System.Collections;
using Facebook.Unity;
using System.Collections.Generic;
using UnityEngine.UI;

public class SharePhoto : MonoBehaviour {

    //public GameObject LoginText;

    void Awake()
    {
//        LoginText.SetActive(false);
        FB.Init(SetInit, OnHideUnity);
    }

    void SetInit()
    {
        if(FB.IsLoggedIn)
        {
            Debug.Log("Facebook is logged in");
        }
        else
        {
            Debug.Log("Facebook is not logged in");
        }
    }

    void OnHideUnity(bool isGameShown)
    {
        if(!isGameShown)
        {
            Time.timeScale = 0;
        }
        else
        {
            Time.timeScale = 1;
        }
    }

    public void GetPublicPermssion()
    {
        FB.LogInWithPublishPermissions (new List<string>(){"publish_actions"},AuthCallback);
    }

    void AuthCallback(IResult result)
    {
        if(result.Error != null)
        {
            Debug.Log(result.Error + " Could not get the permission");
        }
        else
        {
            if(FB.IsLoggedIn)
            {
                foreach(string perm in AccessToken.CurrentAccessToken.Permissions) {
                    // log each granted permission
                    Debug.Log(perm);
                }

                Debug.Log("Facebook is logged in");
                int score = 10000;

                var scoreData =
                    new Dictionary<string, string>() {{"score", score.ToString()}};
                FB.API ("/me/scores", HttpMethod.POST, APICallback, scoreData);
            }
            else
            {
                Debug.Log("Facebook is not logged in");
            }
        }
    }

    void APICallback(IResult result)
    {
        if(result.Error != null)
        {
            Debug.Log(result.Error + "Failed to post the score");
        }
        else{
        //    LoginText.SetActive(true);
            Debug.Log("Your score has been posted");
        }
    }
}

Just a stab in the dark here but when you try to log into Gmail remotely you actually have to get a special access code for that account. One would assume Facebook has similar security measures, though I guess you probably did that already. As is obvious, I’m not familiar with this at all :).

Also, try and use the insert code option when posting, so what you have written is more legible :).

Thank for your response EI-Presidente. I actually have asked for permission before posting it to a Facebook page. Also, Editing the post with insert code option as you suggested :):wink: