private bool SetAppProperties(Dictionary <string, string> properties, bool isAsync, SetAppPropertiesCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.admin.setAppProperties" } }; Utilities.AddJSONAssociativeArray(parameterList, "properties", properties); if (isAsync) { SendRequestAsync <admin_getAppProperties_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state); return(true); } var response = SendRequest <admin_setAppProperties_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return(response == null ? true : response.TypedValue); }
private bool SetAppProperties(Dictionary<string, string> properties, bool isAsync, SetAppPropertiesCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.admin.setAppProperties" } }; Utilities.AddJSONAssociativeArray(parameterList, "properties", properties); if (isAsync) { SendRequestAsync<admin_getAppProperties_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted<bool>(callback), state); return true; } var response = SendRequest<admin_setAppProperties_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey)); return response == null ? true : response.TypedValue; }
/// <summary> /// Sets values for properties for your applications in the Facebook Developer application. /// </summary> /// <example> /// <code> /// private static void RunWebDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// Dictionary<string, string> properties = new Dictionary<string, string> { { "privacy_url", "http://localhost/" } }; /// api.Admin.SetAppPropertiesAsync(properties, AsyncWebDemoCompleted, null); /// } /// /// private static void AsyncWebDemoCompleted(bool result, Object state, FacebookException e) /// { /// bool actual = result; /// } /// </code> /// </example> /// <param name="properties">A Dictionary of property names to new values. This call will fail if values have the wrong type.</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 true if the set is successful.</returns> public void SetAppPropertiesAsync(Dictionary <string, string> properties, SetAppPropertiesCallback callback, Object state) { SetAppProperties(properties, true, callback, state); }
/// <summary> /// Sets values for properties for your applications in the Facebook Developer application. /// </summary> /// <example> /// <code> /// private static void RunWebDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// Dictionary<string, string> properties = new Dictionary<string, string> { { "privacy_url", "http://localhost/" } }; /// api.Admin.SetAppPropertiesAsync(properties, AsyncWebDemoCompleted, null); /// } /// /// private static void AsyncWebDemoCompleted(bool result, Object state, FacebookException e) /// { /// bool actual = result; /// } /// </code> /// </example> /// <param name="properties">A Dictionary of property names to new values. This call will fail if values have the wrong type.</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 true if the set is successful.</returns> public void SetAppPropertiesAsync(Dictionary<string, string> properties, SetAppPropertiesCallback callback, Object state) { SetAppProperties(properties, true, callback, state); }