private bool RevokeApiAccess(string permissions_apikey, bool isAsync, RevokeApiAccessCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.permissions.revokeApiAccess" } }; Utilities.AddRequiredParameter(parameterList, "permissions_apikey", permissions_apikey); if (isAsync) { SendRequestAsync <permissions_revokeApiAccess_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state); return(true); } var response = SendRequest <permissions_revokeApiAccess_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return(response == null ? true : response.TypedValue); }
private bool RevokeApiAccess(string permissions_apikey, bool isAsync, RevokeApiAccessCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.permissions.revokeApiAccess" } }; Utilities.AddRequiredParameter(parameterList, "permissions_apikey", permissions_apikey); if (isAsync) { SendRequestAsync<permissions_revokeApiAccess_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state); return true; } var response = SendRequest<permissions_revokeApiAccess_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return response == null ? true : response.TypedValue; }
/// <summary> /// This method revokes the API access granted to the specified application. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// api.Permissions.RevokeApiAccessAsync(Constants.WebApplicationKey2, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="permissions_apikey">The API key for the target application.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>The method returns a bool value indicating whether the call succeeded or failed.</returns> public bool RevokeApiAccessAsync(string permissions_apikey, RevokeApiAccessCallback callback, Object state) { return(RevokeApiAccess(permissions_apikey, true, callback, state)); }
/// <summary> /// This method revokes the API access granted to the specified application. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// api.Permissions.RevokeApiAccessAsync(Constants.WebApplicationKey2, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="permissions_apikey">The API key for the target application.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>The method returns a bool value indicating whether the call succeeded or failed.</returns> public bool RevokeApiAccessAsync(string permissions_apikey, RevokeApiAccessCallback callback, Object state) { return RevokeApiAccess(permissions_apikey, true, callback, state); }