コード例 #1
0
ファイル: SA_FB_GraphAPI.cs プロジェクト: NikolasCH/WFW-CLAS
        /// <summary>
        /// This edge allows you to:
        /// get the User's friends who have installed the app making the query
        /// get the User's total number of friends (including those who have not installed the app making the query)
        /// <para>Requires  <b>"user_friends" </b> permission
        /// <see cref="https://developers.facebook.com/docs/graph-api/reference/user/friends"/> for information </para>
        /// </summary>
        /// <param name="limit">Result limit </param>
        /// <param name="callback">Request callback </param>
        /// <param name="cursor">Pagination cursor pointer </param>
        public void GetFriends(int limit, Action <SA_FB_GraphFriendsListResult> callback, SA_FB_Cursor cursor = null)
        {
            var request = new SA_FB_RequestBuilder("/me?fields=friends");

            request.AddLimit(limit);
            request.AddCommand("fields", "first_name,id,last_name,name,link,locale,picture");
            request.AddCursor(cursor);

            SA_FB.API(request.RequestString, HttpMethod.GET,
                      (IGraphResult graphResult) =>
            {
                var result = new SA_FB_GraphFriendsListResult(graphResult);
                callback.Invoke(result);
            });
        }