Facebook connect

Feb 1, 2009 at 4:10 AM
I am trying to make a Facebook Connect website.  Anybody know of a .NET API for Connect? Thanks!
Feb 4, 2009 at 6:06 PM
Edited Feb 4, 2009 at 6:08 PM
The Facebook Developer toolkit works with Facebook Connect, I am using it on my .net site, here is some example code from my .net site, hope it helps:

aspx:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default1.aspx.cs" Inherits="_Default1" %>
<%@ Register assembly="facebook.web" namespace="facebook.web" tagprefix="cc1" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo</title>
</head>

<body>
    
    
    
   Demo
<div id="user">
    
    
</div>
<fb:login-button length="long" onlogin="update_user_box();"></fb:login-button>
    <script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
    <script type="text/javascript">
    function update_user_box()
    {
    
        var user_box = document.getElementById("user");
        user_box.innerHTML =
        "<span>"
        +"<fb:profile-pic uid = 'loggedinuser' facebook-logo='true'></fb:profile-pic>"
        +"Welcome, <fb:name uid = 'loggedinuser' useyou='false'></fb:name>."
        +"<br>You are logged in with your Facebook account."
        +"</span>";
        
        FB.XFBML.Host.parseDomTree();
    }
    FB_RequireFeatures(["XFBML"], function() {
         FB.init("5645g454565g45y45645y45yhg", "xd_receiver.htm");
         FB.Facebook.get_sessionState().waitUntilReady(function() {
            if(FB.Connect != null)
             FB.Connect.ifUserConnected(update_user_box);

         });
     });
     FB.init("5645g454565g45y45645y45yhg", "xd_receiver.htm");
    if(FB.Connect != null)
        FB.Connect.ifUserConnected(update_user_box);
    </script>
    
    
    <form id="form1" runat="server">
    
    
    
    
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
        Text="Load Profile" />
    <br />
    
    <asp:Label ID="Label1" runat="server"></asp:Label>
    
    
    <br />
    
    <table style="width:100%;">
        <tr>
            <td>
                <cc1:UserProfile ID="UserProfile1" runat="server" /></td>
            <td>
                <cc1:PhotoAlbum ID="PhotoAlbum1" runat="server" /></td>
            <td>
                </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                <cc1:FriendList ID="FriendList1" runat="server"
        onfriendclick="FriendList1_FriendClick" /></td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <br />
    
    
    
    
    <br />
    
    </form>
</body>
</html>



aspx.cs:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using facebook;
using facebook.web;
using facebook.Schema;
using System.Collections.Generic;
using System.Collections.ObjectModel;

public partial class _Default1 : System.Web.UI.Page
{
    static facebook.API api;
    protected void Page_PreInit(object sender, EventArgs e)
    {
      
    }
  
    protected void Page_Load(object sender, EventArgs e)
    {
       
        if (!IsPostBack)
        {
            api = new facebook.API();
            api.ApplicationKey = "5645g454565g45y45645y45yhg";
            api.Secret = "45y45g45yh45h46u546j45j546j546j54";
        }


    }
    private static string GetFacebookCookie(string name)
    {

        if (HttpContext.Current == null)
            throw new ApplicationException("HttpContext cannot be null.");

        string fullName = "5645g454565g45y45645y45yhg" + "_" + name;
        if (HttpContext.Current.Request.Cookies[fullName] == null)
            throw new ApplicationException("Could not find facebook cookie named " + fullName);


        return HttpContext.Current.Request.Cookies[fullName].Value;


    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        api.SessionKey = GetFacebookCookie("session_key");
        api.uid = int.Parse(GetFacebookCookie("user"));

        IList<user> friends = api.friends.getUserObjects();

        user u = new user();
        u = api.users.getInfo(api.uid);
        UserProfile1.User = u;
        PhotoAlbum1.UserId = Convert.ToInt32(api.uid);
        PhotoAlbum1.LoadAlbums(api, Convert.ToInt32(api.uid));
        FriendList1.Friends = friends;
        
        //Label1.Text = api.users.getInfo(GetFacebookCookie("user")).First().name;
    }



    protected void FriendList1_FriendClick(object sender, FriendListItemClickEventArgs e)
    {
        user u = new user();
        u = api.users.getInfo(long.Parse(e.FriendId));
        
        UserProfile1.User = u;
        api.SessionKey = GetFacebookCookie("session_key");
        PhotoAlbum1.LoadAlbums(api, Convert.ToInt32(e.FriendId));
        
    }
}
Feb 20, 2009 at 5:32 PM
I followed this example and im getting an exception at : IList<user> friends = api.friends.getUserObjects();

It says "Remote server error: (417) Expectation Failed.
Feb 20, 2009 at 8:33 PM
if it is failing at that method call I am guessing you have something wrong with your api key or secret, make sure you filled all three places in the cs file for api and secret. If that is all correct in may just be a fluke (417) is a pretty generic error: http://www.checkupdown.com/status/E417.html

Are you logged in, and is your profile pic displayed on the page?
-Will

Mar 2, 2009 at 3:28 AM

Big Bird,

A big thanks to you for putting your code in your post here.  I have learned a lot from it that I couldn't find elsewhere--and I have looked hard for some useful sample code..

Could you tell me if the PhotoAlbum control is completely functional?  I get it showing albums for different friends, and going from image to image, but have no clue as to how the associated dropdown list box that is part of the control works.  So I am stuck on album 0 for any user that has an album 0 and if they have more, I am still stuck at album 0 even if I click other albums.

 

Could you point me to a property or concept or give me a model that will give me some clue of how it should work?   And is there any way to get the current picture ID from the PhotoAlbum control?

 

Also, is this control so primitive that it is not worth learning and one should just develop their own control?  I mean if it just displays postage size stamps, I am not sure what the point is.

 

Thank you.

Mar 2, 2009 at 9:43 PM
I'm glad my code helped out :) I have run into the same problems with the photoalbum control.  Unfortunately I didn't end up needing the photoalbum control in my project so I haven't researched it very thoroughly, but you may try a couple of things:

-check the 'UseViewState' property, make sure it is set to true
-get the photos manually using the api.photos.getAlbums() method (or some of the other methods in api.photos)

it would seem that the PhotoAlbum control isn't very well supported, I probably wouldn't even use it to get photos, just use the photos.get() method

-Will
Mar 3, 2009 at 12:59 AM
Edited Mar 8, 2009 at 12:34 AM
Thanks, Will.  I think I had everything set correctly, so I think I will just step away from that control and create any related functionality from the relevant classes.  It was quite a time waster, but once I got your code at least I was able to see the first album.  And I got a stronger sense of the toolkit as a result, which is a big plus.  But I did have to integrate some things from the User's Guide 2.0 first example to make it work for me.  I am just stating that for anyone who may have any issues with your code not working instantly after visiting this page, which is the best I found after looking around a lot.  Though I did just copy parts of your code, so perhaps if they grab the whole thing they will be fine.  Otherwise they will have to generally know what they are doing with C# and ASP.NET.

Thanks again. 

Reid

Update--> I did copy all of your code and it does indeed work as written.  I see one has to click the Facebook Connect button to make it work, as just loading the profile without doing that fails.  It is very useful example code. 
Mar 16, 2009 at 5:52 AM
Say Will, I wonder if you know of any solution to someone logging out at www.facebook.com while a Facebook Connect application is open.  What I have observed to happen is that if the session ID is needed, the Facebook Connect app blows up.

Steps to reproduce:

  1. Sign into Facebook with "Remember me" checked.
  2. Bring up a Facebook Connect app (like the one here)
  3. Go back to Facebook while your Facebook Connect app is still running and log out at Facebook
  4. Continue playing with your app, such as in the immediate case, click the Load button.
For me this stuff goes boom.  And after a while of searching for a solution I have found nothing.  What seems to happen is that the app is now in limbo land; it thinks it has a good session key so it doesn't try to create a new one, but the key doesn't work.

So if you know of any solution please post it.

Reid
Developer
Apr 10, 2009 at 4:12 PM
Edited Apr 11, 2009 at 8:04 PM
I've managed to integrate Facebook Connect on ASP .NET MVC. There are some details here. I have attached some code changes to the toolkit here as well. For the complete implementation , it is now part of raya, http://www.codeplex.com/raya. Unfortunately, you will need to get the code off SVN. Fortunately, you can safely ignore the OpenSocial part.

What you're interested is probably the updates to the toolkit and Facebook.cs in the raya project. Also, you will need CRC32.cs for calculating the email hashes. Have a look at the loginBase class for the Facebook connect related stuff and the method getLoggedIn().

I think the only way you can tell if the session key is valid or not is to actually use it, catch the exception if it fails and clear all the facebook cookies. Hope that helps.
Apr 13, 2009 at 11:11 AM
A big thanks to big bird for posting a working example its saved for days of googling for bits and bobs of code.

has anyone got any example code of publishing stories back to facebook via connect?

Lee
May 19, 2009 at 2:28 AM

hi guys, new here i tried the sample on my visual studio 2008 and had the following error "Could not load file or assembly 'facebook, version=2.0.3230.29787, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."  I google it and did not manage to find much information about it and btw does the sample work with using IIS 5.1 which i am using currently. Hope anyone could help.  Thanks in advance.

May 19, 2009 at 4:07 AM

To instinctzen: yes it does work with iis 5.1.   I've run it on XP Pro with no problems.  Good luck.

May 19, 2009 at 4:27 AM

thx for the quick reply but had u experience any problem with the version of the control i had add reference using bin of v2.0 toolkit the dll with v2.0 was also use for my controls i wonder what cause the problem...search online found that bigbird had the problem too but no conclusion on that..

Jun 3, 2009 at 6:38 AM

I some times run into a problem, where I am not logged in facebook.com, but my session is still active and it looks like I am still logged in, which then prevents me from logging out of the site.

Do I need to clear some sessions in the codebehind when logging out of Facebook Connect?

Jun 30, 2009 at 10:31 PM

Hi All,

This code looks like a big help, but I seem to be having some problems getting set up on development, so if anyone could help me, that would be great!

I created an application on facebook (so I have an AppKey/Secret) and I set it up to point to a folder I have under localhost. (I was trying to go through the Smiley.Net sample code but that was failing for me...)

When I go through all the code above and replace the app keys with my own key, and click on the Connect to Facebook button, I get a popup which says "

Under Construction

Smiley.NET is under construction.

Note to application developers:

To fix this error, please set your Connect URL in the application settings editor. Once it has been set, users will be redirected to that URL instead of this page after logging in."

After that, when I click on Load Profile, I have an exception thrown on reading the cookies because they don't exist.

Any help would be greatly appreciated!
Jul 21, 2009 at 8:07 AM

I have tryied the code (and many other .NET samples) and have the same problems with Liron K but there isn't any solutions.

Have you fix the problems ? Is there anyone can help me ?

I'm absolutely sure that I have replaced the API Key, Application Secret, Canvas Callback URL exactly and my browser works properly (allowing cookie too). I've tried to understand why but I can't.

Thanks in advanced.

 

Jul 21, 2009 at 3:46 PM

I've been absent from this tread for a long time, sry =)

in response to Liron & uyhung, My best guess is that you may have missed a step in the initial setup.

Did you follow all the instructions here: http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site#Referencing_Facebook_Connect_on_Your_Site

Its been a long time since I've worked with this stuff, but I also remember having a problem with the Connect URL I used, it is very picky, and I don't think I ever got it working on localhost...  I did all my development on my live site...

If you have access to a hosted server I would try that and make sure the Connect URL is set to that domain...

Just a guess, hope it helps

-Will

Jul 22, 2009 at 2:17 AM

Thanks for your guess.

I'm absolutely I've followed all the steps in the instructions.

I've tried to do all my development on my live site too, the Canvas Callback URL is "http://vietnam.krestondts.com.au", everyone can browse to the site from anywhere on the world, it's not just a local site.

It's weird that when I browse the site directly from local IIS, the ste works well (loigin to Facebook  get the user information successfully).

 

Jul 22, 2009 at 2:55 AM

Sorry big bird, sorry all

I've checked all the steps in the instructions and I found that I have mistaken between The Canvas Callback URL and The Connect URL.

The sample has worked well.

Thanks a lot

Jul 23, 2009 at 4:53 AM

I want to login to Facebook from my web application but doesn't use the Facebook login button. For example login to Facebook by a backgound request URL. Is there anyone can tell me a solution ?
Thanks in advanced

Jul 23, 2009 at 11:54 AM

This might solve your problem uyhung;

 

I have the following function in javascript, which raises a postbackevent, so I can handle the user with the facebookdevelopertoolkit

    <script type="text/javascript">
        //<![CDATA[
        function fb_login() {
            FB_RequireFeatures(["Api"], function() {
                FB.Connect.requireSession(function(exception) {
                    __doPostBack('ctl00','facebooklogin');
                });
            });
        }; //]]> </script>
The user logs in by clicking on the following url:
<a id="ctl00_hlFacebookLogin"  onclick="fb_login(); return false;" href="#">Login with facebook</a>
In my codebehind i have added the IPostBackEventHandler to mypage which handles the postback
    /// <summary>
    /// Handle postbacks from javascript
    /// </summary>
    /// <param name="eventArgument">event argument</param>
    public void RaisePostBackEvent(string eventArgument)
    {
        switch (eventArgument.ToLower())
        {
            case "facebooklogin":
                 facebook.API api = new facebook.API();
                api.ApplicationKey = ConnectAuthentication.ApiKey;
                api.Secret = ConnectAuthentication.SecretKey;
                api.SessionKey = ConnectAuthentication.SessionKey;
                api.uid = ConnectAuthentication.UserID;

                //Display user data captured from the Facebook API.
                facebook.Schema.user user = api.users.getInfo();
                break;
        }
    }
The ConnectAuthentication-class is from the following article: http://devtacular.com/articles/bkonrad/how-to-retrieve-user-data-from-facebook-connect-in-aspnet/
best regards
Thomas
 

Jul 27, 2009 at 4:58 AM

Thanks Thomas for your solution, it has already solved my problem. Thanks again.

Using the object facebook.Schema.user I can get all the user profile information:

            facebook.Schema.user user = api.users.getInfo();
            lblName.Text = user.first_name + " " + user.last_name;
            lblBirthday.Text = user.birthday;
            lblSex.Text = user.sex;
            lblAboutMe.Text = user.about_me;
            lblInterest.Text = user.interests;
            lblActivies.Text = user.activities;
            lblBooks.Text = user.books;
            lblHomeTownCity.Text = user.hometown_location.city;
            lblHomeTownCountry.Text = user.hometown_location.country;
            lblHomeTownState.Text = user.hometown_location.state;
            lblHomeTownStreet.Text = user.hometown_location.street;
            lblMovies.Text = user.movies;
            lblPolitical.Text = user.political;
            lblMusic.Text = user.music;
            lblTVShows.Text = user.tv;

...except the user profile contact information, I can't find any properties like "user.contact_informations" or "user.mobile_phones" or "user.emails"... to get the user profile contact information.

Is there anyone can help me a solution to get the user profile contact information ?

Thanks in advanced.

 

Jul 27, 2009 at 7:06 AM

Thanks Thomas

But you don't understand me, I mean that I want to connect to Facebook by a backgound url.

Your solution will follow some steps:

- show a link on the page (custom link or use the Facebook Login button rendered by FBML)

- user click on the link and the Facebook login popup will be showed.

- user enter his/her Facebook account and click the button "Connect" on the popup.

- Facebook authenticates the user and return to our browser the cookies which allow us to get the user information.

But I don't want to do like that, I don't want to use the Facebook Login popup.

What I want are:

- my page like a normal login page, which have:

     1. A TextBox named "tbxFacebookAccountEmail" allow user enter his/her Facebook Account email

     2. A TextBox named "tbxFacebookAccountPassword" allow user enter his/her Facebook Account password

     3. A Button named "btnLoginToFacebook" will be clicked when user want to connect to Facebook

- After user enter his/her Facebook email, password and click the button "btnLoginToFacebook", I will send a backgournd url like

"http://www.facebook.com/Login? api_key=[my api key] & secret =[my secret] & user_email=[user email] & pass=[user password] "

My problem is I don't know what is the background URL like that.

Is there anyone know the url or another solution like that ? Please help me

Thanks in advanced.

 

 

 

 

 

Developer
Jul 27, 2009 at 1:59 PM

I'm about 90% sure that there's no way to do this. Facebook intentionally wants users to go to a Facebook page to login so that other sites that claim to be Facebook Connect sites don't steal their Facebook passwords. You have to do the same thing with desktop apps, and there's just no good way around it.

Jul 28, 2009 at 4:30 AM

Thanks jschuster, you're about 90% sure that there's no way to do what I want...it's a sad news for me.

And here is another problems when I use the Facebook API, please help me:

1.Using the object facebook.Schema.user I can get all the user profile information:

            facebook.Schema.user user = api.users.getInfo();
            lblName.Text = user.first_name + " " + user.last_name;
            lblBirthday.Text = user.birthday;
            lblSex.Text = user.sex;
            lblAboutMe.Text = user.about_me;
            lblInterest.Text = user.interests;
            lblActivies.Text = user.activities;
            lblBooks.Text = user.books;
            lblHomeTownCity.Text = user.hometown_location.city;
            lblHomeTownCountry.Text = user.hometown_location.country;
            lblHomeTownState.Text = user.hometown_location.state;
            lblHomeTownStreet.Text = user.hometown_location.street;
            lblMovies.Text = user.movies;
            lblPolitical.Text = user.political;
            lblMusic.Text = user.music;
            lblTVShows.Text = user.tv;

...except the user profile contact information, I can't find any properties like "user.contact_informations" or "user.mobile_phones" or "user.emails"... to get the user profile contact information.

Is there anyone can help me a solution to get the user profile contact information ?

 

2. After the user connect to Facebook from my web appliction, is there any solution to update the user's status (Wall) on Facebook ?

   Does The Facebook API have a method like "user.updateFacebookWall(string status)" ?

Thanks in advanced.

Developer
Jul 28, 2009 at 2:13 PM

I hate to say it, but you're running into just about all of the classic Facebook platform limitations. For a long time, contact info was completely unavailable to developers (to prevent spam). Now, you can at least email users, but it's tricky. You can either use notifications.sendEmail(), or look into the Proxied Email idea: http://wiki.developers.facebook.com/index.php/Proxied_Email

As far as mobile phones go, I believe that info is still blocked, but Facebook has started adding support for SMS messages. There's no support for it in the FDT yet, but if you just check out the docs for sms.canSend and sms.send in the Faccebook wiki, and compare some of the code for other methods, you should be able to write the methods yourself using some of the core methods in the FDT.

If you're just trying to make some sort of address book or directory application where users can look up contact info for their friends, though, I think you're out of luck. That info is still locked away, as far as I know.

The good news is, you CAN update the user's status and/or wall from code. Check out the stream.publish() method. It should be exactly what you need.

 

 

Jul 30, 2009 at 6:38 AM

I have still a problem with the Facebook connect popup.

When I click the button "Connect" on the popup, the popup sometimes doesn't response and it doesn't disappear or redirect too. If I close the popup and click the button "Connect with Facebook" again, the popup appears again

and it works (login successfully -> disappear -> redirect to my Connect URL). But sometimes the popup works well right at the first time I click on the "Connect with Facebook" button.

I don't understand why. May the Facebook popup be not stable ?

Aug 11, 2009 at 11:52 AM

Thanks alot for your information on how to use. But I am getting error when trying to post on the wall using

api.ApplicationKey = ConnectAuthentication.ApiKey;

api.SessionKey = ConnectAuthentication.SessionKey;

api.Secret = ConnectAuthentication.SecretKey;

api.uid = ConnectAuthentication.UserID;

api.stream.publish(txtFacebookWall.Text);

 

I am getting permission error. Some one please let me know if I am missing anything.

Thank you.

 

Aug 12, 2009 at 2:50 AM

Sorry phanikumar and jschuster, I use the codeplex Facebook Toolkit too, but why can't I find the method api.stream.publish(string facebook_wall) ?

When I try to build the solution, Visual Studio reports an error like "facebook.API does not contain a definition for 'stream' and no extension method 'stream' accepting a first argument of type 'facebook.API' could be found (are you missing a using directive or an assembly reference?)".

How can you find the method ? Or you have used another Facebook library ?

I need the method to post a walll or status to Facebook from my application.

Thanks

Aug 12, 2009 at 8:34 AM
Edited Aug 12, 2009 at 8:36 AM

I have used facebook toolkit from codeplex.

All I did is added ref to my project and the magic started working. I have fixed my previous problem actually we have to get permissions to post to facebook wall and it can be achieved like

<a href="#" onclick="FB.Connect.showPermissionDialog('status_update,read_stream,publish_stream', function(x){alert(x);}, false,null);">Grant permissions.</a> 

More information is available here http://wiki.developers.facebook.com/index.php/Extended_permissions

and after that


using facebook;

 

API api = new API();

 

 

api.ApplicationKey = ConnectAuthentication.ApiKey;

api.SessionKey = ConnectAuthentication.SessionKey;

api.Secret = ConnectAuthentication.SecretKey;

api.uid = ConnectAuthentication.UserID;

api.stream.publish(txtFacebookWall.Text);

 

and it worked fine.

 

Aug 12, 2009 at 10:06 PM

trying for 3 days to get this to work.  Finally, I set my application secret key, NOT the session secret key, into the FDT API object, and guess what... WORKED.

 

Aug 17, 2009 at 9:18 PM

David, you are not alone. Same happened here, and it took a couple of days as well. Problem is that it is inherently unsave and a bad practice to use the app key from the client side (I added an issue regarding that, perhaps you can vote for this too).

Personally I grew a little bit frustrated with this toolkit over time. On the one hand it is good work, on the other hand it suffers from things like this one or the dreaded missing  == null bugs. It would be great if there would be the possibility for real community collaboration, however it is extremely hard to get into the source code. I think that if one of the core developers would just put out some tasks like cleaning up the long / ulong issues and clearly defined what to do and where to start we could clean up this toolkit in no time and people would not waste days.

At least for us the facebook toolkit is an essential part of our business, and it's success depends in part on the quality of the code in the toolkit. I sometimes feel that Clarity still thinks of it as a fun demo instead of a serious project.

Anyways, enough ranting...

 

 

Aug 25, 2009 at 10:24 PM

I have a question in respect to the extended permissions.  I am able to get the "Grant Permission" link working, however, what I really want is when a user initally comes to the app, I want to check if they have the extended permissions (which can be accomplished with the API), and if they don't, I want the pop-up to automatically show without them having to click on a link.

Has anyone does this?  Sample code will be great.

Here is what I have right now.  Basically I hide or show the option to add or revoke the permission depending on if the user currently has it or not.  I would like to instantly show the pop-up prompt instead of a link:

<div id="divExtendedPerms" runat="server">
        <fb:prompt-permission perms="publish_stream">
            Grant permission for status updates
        </fb:prompt-permission>
        <br />
</div>
<div id="divRevokeExtendedPerms" runat="server">
     Click <asp:LinkButton ID="lnkRevokeExtendedPerm" runat="server" Text="here" OnClick="lnkRevokeExtendedPerm_Click" /> to revoke publishing permissions.
        <br />
</div>

//Check if user has granted app publishing permissions
divExtendedPerms.Visible = !Master.API.users.hasAppPermission(Enums.Extended_Permissions.publish_stream);

divRevokeExtendedPerms.Visible = Master.API.users.hasAppPermission(Enums.Extended_Permissions.publish_stream);

protected void lnkRevokeExtendedPerm_Click(object sender, EventArgs e)
        {
            Master.API.auth.revokeExtendedPermission(Enums.Extended_Permissions.publish_stream);
        }
Thanks in advance
Sep 6, 2009 at 9:14 AM

I have been trying your source code, bigbird but i hit against a wall with three errors: 

 

Error 2 'ASP.default_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\facebooktest2\c6615b9c\bbf291e9\App_Web_b6-09wir.0.cs 494
Error 3 'ASP.default_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\facebooktest2\c6615b9c\bbf291e9\App_Web_b6-09wir.0.cs 499
Error 4 'ASP.default_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\facebooktest2\c6615b9c\bbf291e9\App_Web_b6-09wir.0.cs 170

Error 2 'ASP.default_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\facebooktest2\c6615b9c\bbf291e9\App_Web_b6-09wir.0.cs 494

Error 3 'ASP.default_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\facebooktest2\c6615b9c\bbf291e9\App_Web_b6-09wir.0.cs 499

Error 4 'ASP.default_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\facebooktest2\c6615b9c\bbf291e9\App_Web_b6-09wir.0.cs 170

I was wondering if any one has come into them before. Some other forum has said that these are due to the namespace however, noone has proposed a solution to the problem.
Thank in advance

 

Sep 8, 2009 at 8:32 AM

instinctzen, i am having the same problem u had [Could not load file or assembly 'facebook, version=2.0.3230.29787, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified]. if you could tell e how u overcame that error or if anybody else has an idea about how to, i would be most grateful thanks.

Nov 4, 2009 at 5:07 PM

Hello everyoine,

I am very new in facebook API, actually it is my first time to work onfacebook API, I tried bigbird's example above, login button is working fine, but I have following errors on creating controls (UserProfile1, photoAlbum1, FriendList1):

Could not load file or assembly 'facebook, Version=2.1.3460.24068, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

I have download facebook.dll file and add as reference, is it because of myversion is not correct? where I cangetcorrect version? By the way,I am working on asp.net 2.0  withvisual studio 2005, do you think facebookAPI can be working on that?

Thanks for any help

 

Jan 20, 2010 at 9:06 AM

Hello,

     I'm very new with Facebook&WordPress integration.

I've successfully installed the plugin and now I have "Publish to facebook Application" and "Publish to Facebook Profile" buttons, and they work fine. It's a great plugin, thank you very much!

Now I've a small problem: I'm currently not using the WordPress Dashboard to post new articles, I'm using a PHP page that posts the article to Wordpress using XML-RPC APIs, and now I want the PHP page to publich the article on WordPress Blog AND share it on facebook without going on the dashboard. Is it feasible?

Thank you.

Ale

Feb 18, 2010 at 12:02 PM

Reid and Will, thank you for all this. I am struggling with the most basic issues right now and will try on my own before I even post something here. As soon as I have some good running code I'll post it.

Mauricio Feijo

Mar 3, 2010 at 10:40 AM

I have tried the source code given by bigbird8891 but it shows error

The type or namespace name 'API' does not exist in the namespace 'Facebook' (are you missing an assembly reference?)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Linq;
using Facebook;
using Facebook.Web;
using Facebook.Schema;
using System.Collections.Generic;
using System.Collections.ObjectModel;

public partial class profile : System.Web.UI.Page
{
    static Facebook.API api;
    protected void Page_PreInit(object sender, EventArgs e)
    {

    }

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            api = new Facebook.API();
            api.ApplicationKey = "";
            api.Secret = "";
        }


    }

Plz help !!! I am using visual studio 2010 express beta 2 .........

 

Mar 18, 2010 at 12:32 PM

subhag...

did you ever find a solution to the build problem?

 

Ian

Mar 18, 2010 at 12:45 PM

subhag... just got it work by using version 2.1 of the binaries... I was using 3.0x

May 8, 2010 at 10:01 AM

Hi Guys, take a look at this tutorial fbtutorial.qsh.eu/section2/step1.aspx

It got me up and running in a jiffy.

Awesome work!