Facebook SDK in Unity: Scores API
Home Forums Tutorial Support Facebook SDK in Unity: Scores API
This topic contains 15 replies, has 15 voices, and was last updated by Muhammad Farhan 2 years, 1 month ago.
-
AuthorPosts
-
January 18, 2016 at 1:51 pm #572
Please post any questions regarding bugs and technical support for this tutorial in this topic. This tutorial will soon be updated with a new one covering changes in Facebook SDK 7.3.0
January 25, 2016 at 7:30 am #617Waiting for the update! 🙂
February 12, 2016 at 7:32 am #665awesome sir.
i am wait sdk 7x and unity 5x for this tutorial.thanks.
February 12, 2016 at 11:12 pm #670Trying to complete this tutorial but, I ran into a snag when trying to get the scores and adding them to the scoresDebug text and the debug.log. How would you access the “Text” from “Iresult” using unity 5.1 and facebook SDK 7.4.0. It won’t let me use result.Text as shown. Thanks for any insight.
March 22, 2016 at 12:37 pm #704there is an issue while sending score. Its not working in Facebook plugin 7.4 can some one guide me its not giving publish permission and secondly how to track an app install, Like user send a app invite to a 2nd user to power up his lives now how can I know that the other user have downloaded the app and I should reward him. kindly explain me with example thanks
April 7, 2016 at 3:20 pm #721Having problems deserializing score in sdk 7.4.0 get null Object Reference error, what should I do?
April 28, 2016 at 2:31 am #732Hi, guys I have a problem here. plz some one help me for scores the submit error (SetScore) the error is like this
Any Idea About this? I search almost whole google website don’t even get the answer
For Lastest Facebook SDK 7.3 and Unity 5.1Score submit result: {“error”:{“message”:”(#100) The parameter score is required”,”type”:”OAuthException”,”code”:100,”fbtrace_id”:”EHXhpJ50mX4″}}
UnityEngine.Debug:Log(Object)
Facebook.FBHolder:<SetScore>m__21(IGraphResult) (at Assets/FacebookSDK/FBHolder.cs:146)
Facebook.Unity.<Start>c__IteratorA:MoveNext() (at Assets/FacebookSDK/SDK/Scripts/Utils/AsyncRequestString.cs:133)June 9, 2016 at 4:58 pm #745Hi im watching your updated videos, but there isnt one for the leaderboard/scores video
So i have been attempting to just work round the old code, i hit a wall wehn it came to the Scores CallBack bit
scoresList = Util.DeserializeScores (result.Text);
This line has changed since then, but cant figure out what the update is, and ive searched alot. i know result.Text is now, result.RawResult as it works, but for the Util im stuck..
Any chance you know the update please?
Thanks- D
June 17, 2016 at 1:07 pm #754Hi. Do you know when you will be updating this tutorial to support sdk 7.4?
this one is just not working.
If you can upload an update soon or let me know. I am willing to pay for this type of support
many thanks
August 8, 2016 at 6:18 pm #764Hi Please Make A Leaderboard Tutorial! We need it
September 11, 2016 at 10:30 pm #770Hi Sir
Your tutorials are awesome , thank you for great tutorials.
i am using unity 5.3 and SDK 7.8, all things are done with the help of your guidance except the score part. i want to show score of friends like you did in this tutorial , here is the code your code can you please set this for new version ?
//// Score Code
public void QueryScores()
{
FB.API (“/app/scores?fields=score,user.limit(30)”, Facebook.HttpMethod.GET, ScoresCallback);
}private void ScoresCallback(FBResult result)
{
Debug.Log (“Scores callback: ” + result.Text);scoresList = Util.DeserializeScores (result.Text);
foreach (Transform child in ScoreScrollList.transform)
{
GameObject.Destroy (child.gameObject);
}foreach (object score in scoresList)
{var entry = (Dictionary<string,object>) score;
var user = (Dictionary<string,object>) entry[“user”];GameObject ScorePanel;
ScorePanel = Instantiate (ScoreEntryPanel) as GameObject;
ScorePanel.transform.parent = ScoreScrollList.transform;Transform ThisScoreName = ScorePanel.transform.Find (“FriendName”);
Transform ThisScoreScore = ScorePanel.transform.Find (“FriendScore”);
Text ScoreName = ThisScoreName.GetComponent<Text>();
Text ScoreScore = ThisScoreScore.GetComponent<Text>();ScoreName.text = user[“name”].ToString();
ScoreScore.text = entry[“score”].ToString();Transform TheUserAvatar = ScorePanel.transform.Find (“FriendAvatar”);
Image UserAvatar = TheUserAvatar.GetComponent<Image>();FB.API (Util.GetPictureURL(user[“id”].ToString (), 128,128), Facebook.HttpMethod.GET, delegate(FBResult pictureResult){
if(pictureResult.Error != null) // if there was an error
{
Debug.Log (pictureResult.Error);
}
else // if everything was fine
{
UserAvatar.sprite = Sprite.Create (pictureResult.Texture, new Rect(0,0,128,128), new Vector2(0,0));
}});
}
}
public void SetScore()
{
var scoreData = new Dictionary<string,string> ();
scoreData [“score”] = Random.Range (10, 200).ToString ();
FB.API (“/me/scores”, Facebook.HttpMethod.POST, delegate(FBResult result) {
Debug.Log (“Score submit result: ” + result.Text);
}, scoreData);
}Thank you
October 30, 2016 at 12:36 am #781Please update the video !!!
January 28, 2017 at 2:55 pm #785Hello. So I used this video to make a leaderboard and it works perfectly. The game is simple you play and u earn some points then if you click a button it loads the scene that lets log in facebook and lets you see your friends scores. But I added a button that lets you play again and the problem is that when the player clicks the button that loads the facebook scene both the NOTLOGGEDINUI and LOGGEDINUI are active. I tried few things that worked in the editor but when i tested it on my phone it didnt.
Thanks.
February 1, 2017 at 4:10 pm #786Also if someone can explain how to use the LogOut() function ill be grateful. Because just having FB.LogOut() doesnt work on my mobile device.
August 7, 2017 at 10:52 am #800hi sir you doing great i am getting this error Score submit result: {“error”:{“message”:”(#200) Requires extended permission: publish_actions”,”type”:”OAuthException”,”code”:200,”fbtrace_id”:”Hi9vzhr+Le6″}}
UnityEngine.Debug:Log(Object) //login from admin accountas tester working fine but score set on concosle no result update on screen
-
AuthorPosts
You must be logged in to reply to this topic.