I have setup several Test users via Facebook developer account. They are friends of each other. When I tried to get friends' scores using
GetTopNRankersFromFacebook
. It only returns the user himself.
I have used
user_friends
permission and linked user facebook account. Anything did I miss?
public void FbLogin()
{
var perms = new List<string>() { "public_profile", "email", "user_friends" };
FB.LogInWithReadPermissions(perms, AuthCallback);
}
private void AuthCallback(ILoginResult result)
{
if (FB.IsLoggedIn)
{
// AccessToken class will have session details
var aToken = Facebook.Unity.AccessToken.CurrentAccessToken;
App42API.Initialize(ConstVariables.APP42_API_KEY, ConstVariables.APP42_SECRET_KEY);
SocialService socialService = App42API.BuildSocialService();
socialService.LinkUserFacebookAccount(aToken.UserId, aToken.TokenString, new LinkCallBack());
scoreBoardService = new ScoreBoardService(ConstVariables.APP42_API_KEY, ConstVariables.APP42_SECRET_KEY);
}
else
{
Debug.Log("User cancelled login");
}
}
Result:
Success Value : {"app42":{"response":{"success":true,"games":{"game":{"name":"Speedy Words","scores":{"score":{"userName":"100407165057496","value":2,"createdOn":"2020-10-26T13:52:03.000Z","scoreId":"_v3sHFvO2uPFR+vv8Jqn06zwgFScw=","facebookProfile":{"name":"Open Graph Test User","id":"100407165057496","picture":"https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=100407165057496&height=50&width=50&ext=1606317087&hash=AeR07F78LainEVBPhHs"}}}}}}}}