Skip to content
Loading
  
  •   
  •   
  •  
  •  
    +2
  • Anil Kumar
    +1
    Hi we can use this, if we want to share,like any think on click on icon,
    but i want to post from my application. what i ll post that shoud be reflect into my post on social media 
    +1
  • Amit Gupta
    +1
    You can use their API to post on the specific platform, goto their website and developer option
    +1
  • Sachin Singh
    +1
    this is how you can post massage with C# on facebook
    1. class Program  
    2. {  
    3.     private const string FacebookApiId = "apiId";  
    4.     private const string FacebookApiSecret = "secret";  
    5.   
    6.     private const string AuthenticationUrlFormat =  
    7.         "https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials&scope=manage_pages,offline_access,publish_stream";  
    8.   
    9.     static void Main(string[] args)  
    10.     {  
    11.         string accessToken = GetAccessToken(FacebookApiId, FacebookApiSecret);  
    12.   
    13.         PostMessage(accessToken, "My message");  
    14.     }  
    15.   
    16.     static string GetAccessToken(string apiId, string apiSecret)  
    17.     {  
    18.         string accessToken = string.Empty;  
    19.         string url = string.Format(AuthenticationUrlFormat, apiId, apiSecret);  
    20.   
    21.         WebRequest request = WebRequest.Create(url);  
    22.         WebResponse response = request.GetResponse();  
    23.   
    24.         using (Stream responseStream = response.GetResponseStream())  
    25.         {  
    26.             StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);  
    27.             String responseString = reader.ReadToEnd();  
    28.   
    29.             NameValueCollection query = HttpUtility.ParseQueryString(responseString);  
    30.   
    31.             accessToken = query["access_token"];  
    32.         }  
    33.   
    34.         if (accessToken.Trim().Length == 0)  
    35.             throw new Exception("There is no Access Token");  
    36.   
    37.         return accessToken;  
    38.     }  
    39.   
    40.     static void PostMessage(string accessToken, string message)  
    41.     {  
    42.         try  
    43.         {  
    44.             FacebookClient facebookClient = new FacebookClient(accessToken);  
    45.   
    46.             dynamic messagePost = new ExpandoObject();  
    47.             messagePost.access_token = accessToken;  
    48.             //messagePost.picture = "[A_PICTURE]";  
    49.             //messagePost.link = "[SOME_LINK]";  
    50.             //messagePost.name = "[SOME_NAME]";  
    51.             //messagePost.caption = "my caption";   
    52.             messagePost.message = message;,  
    53.             //messagePost.description = "my description";  
    54.   
    55.             var result = facebookClient.Post("/[user id]/feed", messagePost);  
    56.         }  
    57.         catch (FacebookOAuthException ex)  
    58.         {  
    59.              //handle something  
    60.         }  
    61.         catch (Exception ex)  
    62.         {  
    63.              //handle something else  
    64.         }  
    65.   
    66.     }  
    67.   
    68.   
    69. } 
     
    +1
  • Ashutosh Gupta
    +1
    you can use their avaiable REST API, Post, those are avilable in development section.
    +1