private bool IsAppAdded(long page_id, bool isAsync, IsAppAddedCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.pages.isAppAdded" } }; Utilities.AddOptionalParameter(parameterList, "page_id", page_id); if (isAsync) { SendRequestAsync <pages_isAppAdded_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state); return(true); } var response = SendRequest <pages_isAppAdded_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return(response == null ? true : response.TypedValue); }
private bool IsAppAdded(long page_id, bool isAsync, IsAppAddedCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.pages.isAppAdded" } }; Utilities.AddOptionalParameter(parameterList, "page_id", page_id); if (isAsync) { SendRequestAsync<pages_isAppAdded_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state); return true; } var response = SendRequest<pages_isAppAdded_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return response == null ? true : response.TypedValue; }
/// <summary> /// Checks whether the Page has added the application. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// api.Pages.IsAppAddedAsync(Constants.PageId, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="page_id">The ID of the Facebook Page.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>Returns true or false.</returns> public void IsAppAddedAsync(long page_id, IsAppAddedCallback callback, Object state) { IsAppAdded(page_id, true, callback, state); }