Exemple #1
0
        private string GetFBML(long uid, int type, bool isAsync, GetFBMLCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.profile.getFBML" }
            };

            Utilities.AddOptionalParameter(parameterList, "uid", uid);
            Utilities.AddOptionalParameter(parameterList, "type", type);

            if (isAsync)
            {
                SendRequestAsync <profile_getFBML_response, string>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <string>(callback), state);
                return(null);
            }

            var response = SendRequest <profile_getFBML_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));

            return(response == null ? null : response.TypedValue);
        }
Exemple #2
0
 /// <summary>
 /// Gets the FBML that is currently set for a user's profile.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret));
 ///     api.Session.UserId = Constants.UserId;
 ///     api.Profile.GetFBMLAsync(Constants.UserId, 1, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(string result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="uid">The user whose profile FBML is to be fetched, or the page ID in case of a Page. This parameter applies only to Web applications and is required by them only if the session_key is not specified. Facebook ignores this parameter if it is passed by a desktop application. </param>
 /// <param name="type">The type of profile box to retrieve. Specify 1 for the original style (wide and narrow column boxes), 2 for profile_main box. (default value is 1)</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>The FBML markup from the user's profile.</returns>
 /// <remarks>It is not a violation of Facebook Privacy policy if you use this method to retrieve content originally rendered by your application from a user's profile, even if Facebook privacy restrictions would otherwise keep you from seeing that user’s profile (for example, you are not friends with the user in question). Cases where this would arise include verifying content posted by one user of your application to another user’s profile complies with the Facebook Developer Terms of Service. </remarks>
 public void GetFBMLAsync(long uid, int type, GetFBMLCallback callback, Object state)
 {
     GetFBML(uid, type, true, callback, state);
 }