private IList <string> UnregisterUsers(List <string> email_hashes, bool isAsync, UnregisterUsersCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.connect.unregisterUsers" } }; Utilities.AddRequiredParameter(parameterList, "email_hashes", JSONHelper.ConvertToJSONArray(email_hashes)); if (isAsync) { SendRequestAsync <connect_unregisterUsers_response, IList <string> >(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <IList <string> >(callback), state); return(null); } var response = SendRequest <connect_unregisterUsers_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return(response.connect_unregisterUsers_response_elt); }
/// <summary> /// Unregisters a previously registered account (using connect.registerUsers). You should call this method if the user deletes his or her account on your site. (for Facebook Connect). /// </summary> /// <example> /// <code> /// private static void RunDemo() /// { /// ConnectSession connectSession = new ConnectSession(Constants.ApplicationKey, Constants.ApplicationSecret); /// /// /// /// /// NOTE: This is shortened for brevity; would require a postback after completing Facebook Connect authentication. /// /// /// /// if (connectSession.IsConnected()) /// { /// Api _api = new Api(connectSession); /// List<string> hashes = new List<string>(); /// hashes.Add(_currentUser.email_hashes.email_hashes_elt[0]); /// _api.Connect.UnregisterUsersAsync(hashes, AsyncDemoCompleted, null); /// } /// } /// /// private static void AsyncDemoCompleted(bool result, object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="email_hashes">An array of email_hashes to unregister.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>This method returns a List of unregistered email hashes. If any email hashes are missing, we recommend that you try unregistering the account again later.</returns> public void UnregisterUsersAsync(List <string> email_hashes, UnregisterUsersCallback callback, Object state) { UnregisterUsers(email_hashes, true, callback, state); }