question

Cenk Akdag avatar image
Cenk Akdag asked

I can not reach Facebook friend's FriendPlayFabId

Let me explain more detailed:

var FriendList = result.Friends; 

Debug.Log("FriendList Count: " + FriendList.Count);

Basic variables here and checking total amount of friend list count.

foreach (PlayFab.ClientModels.FriendInfo Friend in FriendList)
if(Friend.Tags != null)
{
foreach (string tag in Friend.Tags)
{
switch (tag)
{
case "somecase":
//some function
break;
}
else
{
foreach(var item in FriendList)
{
//some function
}
}

I have some tags for some purpose does not matter what for sure. As you imagine I used to receive Facebook friends else case which tags comes null.

What happens now I Friendlist.Count comes correct but information of user with error:

/Client/SetFriendTags: User not found

I guess there is relation with my other problem that I encounter. I can not add friends from web panel when I try it I am receiving blank error that was also reported almost month ago @SethDu.

Which I assume there is something wrong with my Title about friends without tag considering the fact that adding friend from web panel is also without tag. The worst part is my game is live and this bug kills the players affiliation who wants to play game with their Facebook friends.

I am looking forward to see solution for this problem.

Friends
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

Would you use RESTful testing tools like Postman to check the complete response content? According to my previous testing, Add Friend issue only occurs on Game Manager GUI and it doesn't affect direct API usage.

0 Likes 0 ·
Cenk Akdag avatar image Cenk Akdag Seth Du ♦ commented ·

Hi, what I figure it out now actually main problem is "SetFriendTags" in my case.

PlayFabClientAPI.SetFriendTags(new SetFriendTagsRequest() { 
FriendPlayFabId = playfabId,
Tags = newTags
}, result => { Debug.Log("Client Changed Tag"); }, LogFailure);

Even though I reach the user's playfabId when I try change the tag it says user not found. When I shift it to

PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest()
{
FunctionName = "changePlayerTag", // Arbitrary function name (must exist in your uploaded cloud.js file)
FunctionParameter = new { FriendPlayFabId = playfabId, ChosenTag = chosenTag }
}, OnTagChanged, OnFriendError);

I am receiving success message from Cloud that tag has changed but in reality when I check it does not.

But I can change the tags of users who are not user's Facebook friend with no problem at all with the same line of codes.

P.S: I do not have Postman. These codes had been working almost 3 months with no failure and problem. As I can see it started not to work precisely in the same time with that Web panel bug.

0 Likes 0 ·
Cenk Akdag avatar image Cenk Akdag Seth Du ♦ commented ·
@SethDu

Just for reproduce the case I want to share flow with you:

I have Facebook Logged in user Helen A.

As it is shown Helen A. has two friends both Facebook Logged in users. Different between Cenk A. And Linda A. , Linda comes from Facebook friends Cenk A. manually added friend.

When I use the same code:

handlers.changePlayerTag = function(args, context){ 
    
    server.SetFriendTags( 
    { 
    PlayFabId: currentPlayerId, 
    FriendPlayFabId: args.FriendPlayFabId, 
    Tags: ["something"]
    });
}

Both cloud message return without Failure or Error. But Result is:

I am receiving both users playfabId there is also nothing wrong with flow as well. As you can see below playfabIds are identically same

FriendList Count: 2
UnityEngine.Debug:Log (object)
FC8CE8B5AEE8256A
UnityEngine.Debug:Log (object)
9B1913A521568C9A
UnityEngine.Debug:Log (object)

Basically what happens here obviously not on my side also not on the side of Facebook too obviously.

0 Likes 0 ·
state01.png (43.9 KiB)
state02.png (45.2 KiB)
Cenk Akdag avatar image Cenk Akdag Seth Du ♦ commented ·

I found out the precise problem after spending enough time.

Basically Facebook friend's behaviour was changed without warning or announcements or bugged. Because I was able set things on them like regular friend type. Right now case is different. Even though It is shown as a friend in web panel and log, actually it is not till the time I manually add it. That's why I was unable to set or change the tag of it.

If this is not a bug I am sorry but I need to say, what an amateurism.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

Thanks for sharing. For now, Facebook friends behave like temperate PlayFab friends, it disappears when the Facebook token expires, and there is no notification for it. I recommend cache a list of PlayFab friends locally, to compare with updated list after Facebook login, and add all of them for later reference.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.