2 Replies - 1018 Views - Last Post: 04 April 2012 - 07:13 AM Rate Topic: -----

#1 Toadill   User is offline

  • D.I.C Regular

Reputation: 40
  • View blog
  • Posts: 434
  • Joined: 08-January 12

Creating FaceBook applications using the SDK

Posted 04 April 2012 - 06:54 AM

I have ran into a problem trying to create a simple Facebook application. I have searched the forum and I have found no tutorial on this subject yet.

You can download the API SDK for C# to create applications in Facebook.
My problem is that I have not done any kind of web programming before except a long time ago HTML. Therefore I am not understanding how a myToken should be used or even what type it should be to receive data.

Here is my code....

I haven't really started using the API yet...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Facebook;


namespace test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            
            InitializeComponent();
            webBrowser1.Navigate("http://graph.facebook.com/oauth/authorize" + 
                "?client_id=" + myToken.Default.appId +
                "&redirect_uri=http://www.facebook.com/connect/login_success.html" +
                "&display=popup&type=user_agent&scope=user_status,user_photo,email,user_birthday,user_online_presence,publish_stream");
        }

        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (webBrowser1.document.Url.ToString().Contains("access_token"))
            {
                string token = String.Empty;
                string URL = webBrowser1.document.Url.ToString();

                token = URL.Substring(URL.IndexOf("access_token") + 13);
                token = token.Substring(0, token.IndexOf("&"));

                //recive data
                myToken.Default.token = token;
            }
        }
    }
}





Is This A Good Question/Topic? 0
  • +

Replies To: Creating FaceBook applications using the SDK

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15438
  • View blog
  • Posts: 61,855
  • Joined: 12-June 08

Re: Creating FaceBook applications using the SDK

Posted 04 April 2012 - 07:10 AM

Quote

Therefore I am not understanding how a myToken should be used or even what type it should be to receive data.


Without seeing all of the code or where ever that's declared it looks like your authentication information for the app and the user. All the session info for that app to use the user's facebook info and what ever.

Usually the sites require this to be filled correctly to do any action.
Was This Post Helpful? 0
  • +
  • -

#3 Toadill   User is offline

  • D.I.C Regular

Reputation: 40
  • View blog
  • Posts: 434
  • Joined: 08-January 12

Re: Creating FaceBook applications using the SDK

Posted 04 April 2012 - 07:13 AM

Yes I have seen other examples that do access the App ID: and App Secret: although these example were in php rather than C#.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1