Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6657083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:43:24+00:00 2026-05-26T01:43:24+00:00

i am trying to develop an app which can allow me to share data

  • 0

i am trying to develop an app which can allow me to share data on Facebook wall.

For eg: consider the Facebook Canvasapp “Run with Friends”. This is a canvas app using Python and Php.
https://developers.facebook.com/docs/samples/. I will be able to share data from this app to my wall./me

Before doing this v need a access token. I was able to get the authorization, accesstoken using Graph api, Oauth2.0, C#, asp.net

 public string AuthorizationLinkGet(bool bUserInfo, bool bFriends, bool bfeed, bool bPhotos, bool bEvents, bool bMessages)
    {
        string url = string.Format("{0}?client_id={1}&redirect_uri={2}", AUTHORIZE, this.ConsumerKey, CALLBACK_URL);
        if (bUserInfo == true || bFriends == true || bfeed == true || bEvents == true || bPhotos == true || bMessages == true)
        {
            url += "&scope=email";

            if (bUserInfo == true)
            {
                url += ",user_about_me,user_interests,user_likes,user_location,user_notes,user_education_history,user_hometown";
            }
            if (bFriends == true)
            {
                url += ",read_friendlists,user_groups";
            }
            if (bfeed == true)
            {
                url += ",read_stream";
            }
            if (bEvents == true)
            {
                url += ",user_events";
            }
            if (bEvents == true)
            {
                url += ",user_photo_video_tags";
            }
            if (bMessages == true)
            {
                url += ",read_mailbox";
            }
        }
        return url;
    }

 <add key="APIKey" value="*************************"/>
<add key="Secret" value="**********************"/>

So now how do I be able to share data from the app onto my FB wall.
I’ve tried Sharekit but look like Sharekit is for mobile apps.

  public void AccessTokenGet(string authToken)
    {
        this.Token = authToken;
        string accessTokenUrl = string.Format("{0}?client_id={1}&redirect_uri={2}&client_secret={3}&code={4}",
        ACCESS_TOKEN, this.ConsumerKey, CALLBACK_URL, this.ConsumerSecret, authToken);

        string response = WebRequest(Method.GET, accessTokenUrl, String.Empty);

        if (response.Length > 0)
        {
            //Store the returned access_token
            NameValueCollection qs = HttpUtility.ParseQueryString(response);

            if (qs["access_token"] != null)
            {
                this.Token = qs["access_token"];
            }
        }
    }

does any one know how to develop this canvas app in C# using Graph Api

I have no idea abt all the curls and things in Php
Also, I see people using REST, facebookservice, facebook SDK. Where would these fit it?

Thanks

Sun

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:43:25+00:00Added an answer on May 26, 2026 at 1:43 am
    1. Ask for the publish stream permission.
    2. You need to POST to https://graph.facebook.com/USER_ID/feed/access_token=lerolero, posting a json like this:

      {“name”: “name”
      “link”: “http://www.link.com/”,
      “caption”: “title”,
      “description”: “description”,
      “picture”: “http://www.link.com/image.jpg”}

    http://developers.facebook.com/docs/reference/api/, read the publishing section, you can send a lot of other information.

    Edit:

    I see two possibilities.

    1. If the facebook integration its not part of your bussiness rules (if you will not use the user information), you can just add the SHARE widget, in this case, the user will se a button, and when he click the button, the facebook authentication page will open, and when the authentication is done, the share widget will popup automatically.

    2. If you gonna access the user information (if will be somehow attached to the user account), then, when the user clicks the button, you have to check the user account forward a facebook account, if theres not one, you have to open a authentication popup, if the user succeeds to login into facebook, the authentication popup will return you a verification code. You must exchange the verication code for a access token and attach the access token to the user account in your database. In the authentication step, you have to ask for two special permissions, the stream publish permission and the offline access permission. The first one is about the resource to publish in the user wall, and the second one its about the access token life cycle (if you dont ask for this permission, the access token will have a short life cycle, and you will need to reauthenticate the user into facebook again and again, we dont want that).

    Into the code:

    When the user clicks a button, call a ajax function that checks if there’s a access token in the user account. If theres, return the access token (take care here, if you create a ajax that return a access tokem based on a user id, you will have a very bad security issue), if theres not, return false.

    If the code returned is false, call a function that opens a popup with the facebook authentication url. In the facebook authentication popup callback url, just exchange the verification code for a access token and store it in the database. You need to keep listening the popup.closed state, to know when the process is done and call another ajax function that checks if now theres a access token in the user account or not, if not, the user just closed the popup.

    If the code returned is an access token, call a ajax function that post in the user wall, its very easy, like this:

    string facebookurl = "https://graph.facebook.com/me/feed?access_token=32423"
    string parameters = "message=aaaa&link=bbbb";
    WebRequest req = WebRequest.Create(facebookurl);
    req.ContentType = "application/x-www-form-urlencoded";
    req.Method = "POST";
    byte[] bytes = Encoding.ASCII.GetBytes(parameters);
    req.ContentLength = bytes.Length;
    Stream stream = req.GetRequestStream();
    stream.Write(bytes, 0, bytes.Length);
    stream.Close();
    
    WebResponse res = req.GetResponse();
    StreamReader streamReader = new StreamReader(res.GetResponseStream());
    

    If you need any other piece of code, let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to develop an app for my ipad which i can
I am trying to develop an app in Android which can display information about
Im trying to develop my first ASP.NET MVC web app and have run into
I am trying develop an Android app which uses Google maps. So for the
I am trying to develop a Qt App using 4.7.3 which involves the writing
I am trying to develop an iphone app in which matrix of jewel. if
I'm trying to develop an app which uses the Camera. So far it's been
I am trying to develop a web app which applies an appropriate style sheet
I'm using Sqlite with android to develop and app which can be customizable (for
I am trying to develop a collapsable/accordion like feature in my iOS app. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.