-1

The user friend list return no data only summary with total friend count. I am working on a web application which will fetch logged in user face book friend list and then use their birthday to post birthday message in their profile.

Is there a way I can invite the Facebook friend and then access the user friend list because it is a web application.

enter code here
private List<Person> GetPersonFriendList(string access_token,string id)
    {
        List<Person> friendList = new List<Person>();
        string url;
        #region JSON.Net Friends

        //Friends URL
        url = "https://graph.facebook.com/v3.2/" + id + "/taggable_friends?access_token=" + access_token;


        JObject myFriends = JObject.Parse(requestFBData(url));

        //string id = "";
        //string name = "";

        //Loop through the returned friends
       foreach (var i in myFriends["data"].Children())
       {
         Person friend = new Person();
         friend.id = i["id"].ToString().Replace("\"", "");
        friend.name = i["name"].ToString().Replace("\"", "");
       friendList.Add(friend);
        }

        return  friendList;

        #endregion


    }

private static string GetFacebookUserJSON(string access_token) { string url = string.Format("https://graph.facebook.com/me?access_token={0}&fields=email,name,first_name,last_name,link", access_token);

        WebClient wc = new WebClient();
        Stream data = wc.OpenRead(url);
        StreamReader reader = new StreamReader(data);
        string s = reader.ReadToEnd();
        data.Close();
        reader.Close();

        return s;
    }
  • 4
    _“and then use their birthday to post birthday message in their profile”_ - that is not possible any more either. You can not even post to a user’s own private timeline any more via API, and posting to other people’s timelines hasn’t been possible for ages now. Plus, you are not supposed to create apps that just replicate Facebook functionality to begin with … and birthday reminders plus the “it’s xy’s birthday, post on their timeline” _is_ a feature they provide already. Forget about _this_ app concept, it is pretty crappy to begin with. – 04FS Apr 24 '19 at 13:04

1 Answers1

1

taggable_friends is deprecated: https://developers.facebook.com/docs/graph-api/reference/user/taggable_friends/

This edge was deprecated on April 4th, 2018 and now returns an empty data set.

There is no way to access the whole friendlist anymore, you can only get a list of users who authorized your App too, with /me/friends.


...use their birthday to post birthday message in their profile

A friend would need to authorize your App with the user_birthday permission for that. Rule of thumb: No data at all from any user without his explicit authorization/permission.

Also, posting on the wall of another user is not possible since a very long time and would be spam - you are not allowed to autopost or prefill anyway. Last but not least, you cannot even post to your own wall anymore, because publish_actions was deprecated too.

luschn
  • 68,448
  • 8
  • 104
  • 118
  • Thanks for your response. This means that no such application can be build which can automatically post on your friends wall to wish him/her on their Birthday.. – user2294117 Apr 29 '19 at 12:15
  • of course not, that would be pure spam...user messages/posts on facebook should never be automated. – luschn Apr 29 '19 at 12:42