예제 #1
0
        /// <summary>
        /// Returns the current allocation limits for your application for the specified integration points. Allocation limits are determined daily.
        /// </summary>
        /// <returns>The requested allocation</returns>
        public bool setAppProperties(Dictionary <string, string> properties)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.admin.setAppProperties" }
            };

            _api.AddJSONAssociativeArray(parameterList, "properties", properties);
            string response = _api.SendRequest(parameterList);

            return(string.IsNullOrEmpty(response) || admin_setAppProperties_response.Parse(response).TypedValue);
        }
예제 #2
0
        /// <summary>
        /// Lets you insert text strings in their native language into the Facebook Translations database so they can be translated. See Translating Platform Applications for more information about translating your applications.
        /// </summary>
        /// <param name="native_strings">A JSON-encoded array of strings to translate. Each element of the string array is another array, with text storing the actual string, description storing the description of the text. </param>
        /// <returns>If successful, this method returns the number of strings uploaded. </returns>
        public bool uploadNativeStrings(Dictionary <string, string> native_strings)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.fbml.uploadNativeStrings" }
            };

            _api.AddJSONAssociativeArray(parameterList, "native_strings", native_strings);

            var response = _api.SendRequest(parameterList);

            return(string.IsNullOrEmpty(response) || fbml_uploadNativeStrings_response.Parse(response).TypedValue);
        }
예제 #3
0
파일: feed.cs 프로젝트: wsgan001/asegrp
        /// <summary>
        /// Publishes a Mini-Feed story to the user corresponding to the session_key parameter, and publishes News Feed stories to the friends of that user who have added the application.
        /// </summary>
        /// <param name="title_template">The templatized markup displayed in the feed story's title section. This template must contain the token {actor} somewhere in it.</param>
        /// <param name="title_data">Optional - A JSON-encoded associative array of the values that should be substituted into the templates in the title_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special tokens and should not be included in this array. If your title_template contains tokens besides 'actor' and 'target', then this is a required parameter.</param>
        /// <param name="body_template">Optional - The markup displayed in the feed story's body section.</param>
        /// <param name="body_data">Optional - A JSON-encoded associative array of the values that should be substituted into the templates in the body_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special token and should not be included in this array.</param>
        /// <param name="body_general">Optional - Additional markup displayed in the feed story's body section. This markup is not required to be identical for two stories to be aggregated. One of the two will be chosen at random.</param>
        /// <param name="page_actor_id">Optional - if publishing a story to a Facebook Page, use this parameter as the page who performed the action. If you use this parameter, the application must be added to that Page's Feed. A session key is not required to do this.</param>
        /// <param name="images"></param>
        /// <param name="target_ids"></param>
        /// <returns></returns>
        public bool publishTemplatizedAction(string title_template, Dictionary <string, string> title_data,
                                             string body_template, Dictionary <string, string> body_data,
                                             string body_general, int page_actor_id,
                                             Collection <feed_image> images, Collection <string> target_ids)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.feed.publishTemplatizedAction" }
            };

            _api.AddRequiredParameter(parameterList, "title_template", title_template);
            _api.AddOptionalParameter(parameterList, "page_actor_id", page_actor_id);
            _api.AddJSONAssociativeArray(parameterList, "title_data", title_data);
            _api.AddJSONAssociativeArray(parameterList, "body_data", body_data);
            _api.AddOptionalParameter(parameterList, "body_template", body_template);
            _api.AddOptionalParameter(parameterList, "body_general", body_general);
            _api.AddCollection(parameterList, "target_ids", target_ids);
            AddFeedImages(parameterList, images);

            var response = _api.SendRequest(parameterList);

            return(string.IsNullOrEmpty(response) || feed_publishTemplatizedAction_response.Parse(response).TypedValue);
        }
예제 #4
0
        /// <summary>
        /// Creates or modifies a listing in Marketplace. You may only create and modify a listing for a user
        /// who has granted the application the extended permission create_listing.
        /// </summary>
        /// <param name="listing_id">The listing ID to modify, or 0 if the user is creating a new listing.</param>
        /// <param name="show_on_profile">A privacy control indicating whether to display the listing on the poster's profile.</param>
        /// <param name="listing_attrs">Collection of Marketplace Listing Attributes.</param>
        /// <returns>This method returns the listing ID of the modified/created listing. If you are modifying a listing, it is the same as the listing ID provided to the method.</returns>
        public long createListing(long listing_id, bool show_on_profile, Dictionary <string, string> listing_attrs)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.marketplace.createListing" }
            };

            _api.AddRequiredParameter(parameterList, "listing_id", listing_id);
            _api.AddParameter(parameterList, "subcategory", show_on_profile);
            _api.AddJSONAssociativeArray(parameterList, "listing_attrs", listing_attrs);

            var response = _api.SendRequest(parameterList);

            return(!string.IsNullOrEmpty(response) ? marketplace_createListing_response.Parse(response).TypedValue : 0);
        }
예제 #5
0
파일: events.cs 프로젝트: wsgan001/asegrp
        /// <summary>
        /// Create an event - You must pass the following parameters in the event_info array:
        ///name
        ///category
        ///subcategory
        ///location
        ///start_time
        ///end_time
        ///Note: The start_time and end_time are the times that were input by the event creator, converted to UTC after assuming that they were in Pacific time (Daylight Savings or Standard, depending on the date of the event), then converted into Unix epoch time.
        ///
        ///Optionally, you can pass the following parameters in the event_info array:
        ///
        ///street
        ///phone
        ///email
        ///host_id
        ///host
        ///desc
        ///privacy_type
        ///tagline
        /// </summary>
        /// <param name="event_info">key value pairs describin the event.</param>
        /// <returns>The eid of the created event</returns>
        public long create(facebookevent event_info)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.events.create" }
            };
            var dict = new Dictionary <string, string>
            {
                { "description", event_info.description },
                { "end_time", event_info.end_time.ToString() },
                { "category", event_info.event_type },
                { "subcategory", event_info.event_subtype },
                { "host", event_info.host },
                { "location", event_info.location },
                { "name", event_info.name },
                { "start_time", event_info.start_time.ToString() },
                { "tagline", event_info.tagline }
            };

            _api.AddJSONAssociativeArray(parameterList, "event_info", dict);

            var response = _api.SendRequest(parameterList);

            return(!string.IsNullOrEmpty(response) ? events_create_response.Parse(response).TypedValue : 0);
        }
예제 #6
0
        /// <summary>
        /// Sends a live message to a particular user's browser, which should be handled in FBJS. Messages can only be sent and received by users who have accepted your application's Terms of Service.
        /// </summary>
        /// <param name="recipient">The message recipient. </param>
        /// <param name="event_name">Name of the "event" for which messages will be sent and received (max length: 128 bytes). A LiveMessage FBJS object must be initialized with this event name to receive the message. </param>
        /// <param name="message">A JSON-encoded string of the message to send (max length: 1024 bytes). </param>
        /// <returns>Boolean of success or failure.</returns>
        public bool send(long recipient, string event_name, string message)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.liveMessage.send" }
            };

            _api.AddRequiredParameter(parameterList, "recipient", recipient.ToString());
            _api.AddRequiredParameter(parameterList, "event_name", event_name);
            _api.AddJSONAssociativeArray(parameterList, "message", new Dictionary <string, string> {
                { "from", _api.uid.ToString() }, { "msg", message }
            });

            var response = _api.SendRequest(parameterList);

            return(string.IsNullOrEmpty(response) || liveMessage_send_response.Parse(response).TypedValue);
        }