MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Any way to connect my blog with facebook ?   (Mono Support )

Viewed 50670 time(s), 5 post(s) 1/22/2013 8:25:59 PMby super
super

super

1/22/2013 8:25:59 PM
Any way to connect my blog with facebook ? so that whatever is being posted on the blog posted automatically on facebook too ?
This content has not been rated yet. 
6018 Reputation 709 Total posts
imarusic

imarusic

1/23/2013 9:31:46 AM
Hi,

currently that is not automatically implemented, but you can use MonoX share provider to achieve functionlity you need.

Regards.
This content has not been rated yet. 
3016 Reputation 428 Total posts
super

super

1/23/2013 4:48:42 PM
I know about sharing but that is not feasible for each n every post since it is very time consuming. It would be great if this feature is added in monox.
This content has not been rated yet. 
6018 Reputation 709 Total posts
mzilic

mzilic

1/23/2013 5:21:36 PM
Hello super,

The following feature is not supported directly by MonoX and requires custom coding. We have developed similar features for custom projects however.

First please make sure that you are following these guidelines to create a custom MonoX based project.

Next you need to select an SDK you would like to use for your Facebook integration, we have used Facebook C# SDK.  One of my coworkers wrote an article on this subject and you can read it here. The article will demonstrate you how to setup your own Facebook application and how to fetch users profile. This is a sample code which can be used to post a message on a users wall, please note that the sample is based on Facebook C# SDK:
            /// <summary>
        /// Posts a message to wall.
        /// </summary>
        /// <param name="accessToken">User access token.</param>
        /// <param name="title">Message title.</param>
        /// <param name="description">Message description.</param>
        /// <param name="link">Message link.</param>
        /// <param name="imageUrl">Custom image url.</param>
        /// <returns></returns>       
          public bool PostMessageToWall(string accessToken, string title, string description, string link, string imageUrl)
        {
            Facebook.Web.FacebookWebClient client = new Facebook.Web.FacebookWebClient(accessToken); // facebook user access token see here for more info http://developers.facebook.com/docs/reference/api/
            Dictionary<string, object> args = new Dictionary<string, object>();        
            args["from"] = ApplicationSettings.FacebookApplicationId; // this would be your own application id which you obtain from facebook
            args["description"] = description;
            args["name"] = title;
            args["link"] = link;
            args["picture"] = imageUrl;
            var obj = client.Post("/me/feed", args);
            JsonObject post = obj as JsonObject;
            if (post != null)
            {
                if (post.ContainsKey("id") && post["id"] != null)
                {
                    string id = post["id"].ToString();
                    if (!string.IsNullOrWhiteSpace(id))
                        return true;
                }
            }
            return false;
        }
Now that we have covered the Facebook integration, here is a related blog post.This article demonstrates the steps required to push blog posts to Blogger. The MonoX implementation section will be of an interest to you since it explains the steps needed to push any blog post to an external service.

Regards,
Mario
Rated 5.00, 1 vote(s). 
2218 Reputation 300 Total posts
super

super

1/23/2013 5:41:01 PM
thank you mario for the code - I deeply appreciate it
This content has not been rated yet. 
6018 Reputation 709 Total posts