private IList<user> GetStandardInfo(string uids, IList<string> fields, bool isAsync, GetStandardInfoCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.users.getStandardInfo" } }; Utilities.AddOptionalParameter(parameterList, "uids", uids); if (fields != null) { Utilities.AddRequiredParameter(parameterList, "fields", StringHelper.ConvertToCommaSeparated(fields)); } else { Utilities.AddRequiredParameter(parameterList, "fields", "uid, first_name, last_name, name, timezone, birthday, sex, affiliations, proxied_email"); } if (isAsync) { SendRequestAsync<users_getStandardInfo_response, IList<user>>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<IList<user>>(callback), state, "standard_user_info"); return null; } var response = SendRequest<users_getStandardInfo_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return response == null ? null : response.standard_user_info; }
/// <summary> /// Returns an array of user-specific information for use by the application itself. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// string uids = Constants.UserId.ToString(); /// List<string> fields = new List<string> { "uid", "first_name", "last_name", "name", "profile_url", "proxied_email" }; /// api.Users.GetStandardInfoAsync(uids, fields, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<user> result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="uids">A comma-separated list of user IDs.</param> /// <param name="fields">List of desired fields in return. This is a List of field strings and is limited to these entries only: uid, first_name, last_name, name, timezone, birthday, sex, affiliations (regional type only), locale, profile_url, proxied_email.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>The user info elements returned are those friends visible to the Facebook Platform.</returns> public void GetStandardInfoAsync(string uids, IList<string> fields, GetStandardInfoCallback callback, Object state) { GetStandardInfo(uids, fields, true, callback, state); }
/// <summary> /// Returns an array of user-specific information for use by the application itself. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// List<long> uids = new List<long> { Constants.UserId }; /// List<string> fields = new List<string> { "uid", "first_name", "last_name", "name", "profile_url", "proxied_email" }; /// api.Users.GetStandardInfoAsync(uids, fields, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<user> result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="uids">A List of user IDs.</param> /// <param name="fields">List of desired fields in return. This is a List of field strings and is limited to these entries only: uid, first_name, last_name, name, timezone, birthday, sex, affiliations (regional type only), locale, profile_url, proxied_email.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>The user info elements returned are those friends visible to the Facebook Platform.</returns> public void GetStandardInfoAsync(List<long> uids, IList<string> fields, GetStandardInfoCallback callback, Object state) { GetStandardInfo(StringHelper.ConvertToCommaSeparated(uids), fields, true, callback, state); }
/// <summary> /// Returns an array of user-specific information for use by the application itself. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// string uids = Constants.UserId.ToString(); /// api.Users.GetStandardInfoAsync(uids, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<user> result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="uids">A comma-separated list of user IDs.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>The user info elements returned are those friends visible to the Facebook Platform.</returns> public void GetStandardInfoAsync(string uids, GetStandardInfoCallback callback, Object state) { GetStandardInfoAsync(uids, null, callback, state); }
/// <summary> /// Returns an array of user-specific information for use by the application itself. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// List<long> uids = new List<long> { Constants.UserId }; /// api.Users.GetStandardInfoAsync(uids, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(IList<user> result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="uids">A List of user IDs.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>The user info elements returned are those friends visible to the Facebook Platform.</returns> public void GetStandardInfoAsync(List<long> uids, GetStandardInfoCallback callback, Object state) { GetStandardInfoAsync(uids, null, callback, state); }