facebook-graph-apiunity-game-enginefacebook-unity-sdk

Facebook graph api : Param score must be an integer


I am using sdk version 7.4 when i post the score i get this error

score posted to the fb{"error":{"message":"(#100) Param score must be an integer","type":"OAuthException","code":100,"fbtrace_id":"ElqTb0bxXz4"}}

Concerned Code

var scoreData = new Dictionary<string ,string> ();
    scoreData ["score"] = UnityEngine.Random.Range (10f, 500f).ToString();
    FB.API("/me/scores?fields=",HttpMethod.POST,delegate(IGraphResult result){
    Debug.Log("score posted to the fb"+result.RawResult.ToString());


    },scoreData);

Any Suggestion or answer is appreciated


Solution

  • var scoreData = new Dictionary<string ,int> ();
        scoreData ["score"] = UnityEngine.Random.Range (10, 500);
        FB.API("/me/scores?fields=",HttpMethod.POST,delegate(IGraphResult result){
        Debug.Log("score posted to the fb"+result.RawResult.ToString());
    
    
        },scoreData);