Post a link onto funpage

Aug 5, 2010 at 5:01 PM
Edited Aug 5, 2010 at 6:41 PM
I read greate article http://fbtutorial.computerbeacon.net/section4/feed/link.aspx, and now can post link to user's wall. Please, explain how to post onto funpage wall? How to ask permissions to post on funpage wall?

To ask user I use:
<cc1:PromptPermission ID="perm_publish" runat="server" Perms="publish_stream">
<ContentTemplate>
You must first click here to enable the publishing function.
</ContentTemplate>
</cc1:PromptPermission>



To post on user' wall I use this code:

_Api = new Facebook.Rest.Api(_ConnectSession);
System.Uri url = new Uri("http://site.com/");
_Api.Links.Post(USER_UID, url, "comment");
Aug 6, 2010 at 8:27 AM

This is my solution:

Ask user give permissions to mange his pages:

<cc1:PromptPermission ID="perm_publish" runat="server" Perms="publish_stream">
    <ContentTemplate>
        Click to give permissions to publish (publish_stream)<br />
    </ContentTemplate>
</cc1:PromptPermission>

<cc1:PromptPermission ID="PromptPermission1" runat="server" Perms="manage_pages">
    <ContentTemplate>
        Click to give permissions to pages (manage_pages)
    </ContentTemplate>
</cc1:PromptPermission>

Now you must know fun page id. For example I take it from URL when edit page

http://www.facebook.com/pages/edit/?id=PAGE_ID

 

If you know PAGE_ID and your application have permissions, you can post link onto wall using this code

Facebook.Session.ConnectSession connectSession = new Facebook.Session.ConnectSession(_ApiKey, _ApplicationSecret);
Facebook.Rest.Api api = new Facebook.Rest.Api(connectSession);
System.Uri url = new Uri("http://timeMarker.org/");
api.Links.Post(PAGE_ID, url, "comment");

Aug 6, 2010 at 9:22 AM

Using this solution I can't post onto funpage wall if user is not loggin..

In other words, posting onto funpage wall require a Facebook session (but posting onto user's wall don't require a Facebook session).

How can I post onto funpage wall without ligged user? How can I ask user permissions for that? Or how can I give permission to my application to post onto my funpage (I am administrator) manually?

Aug 6, 2010 at 3:57 PM

PromtPermission-control use "OLD JavaScript SDK". Use this code instead:

1. Login FaceBook
<fb:login-button onlogin="window.location.reload()"></fb:login-button>
2. Give permissions to your wall or/and page(s)
<a href="#" onclick="FB.Connect.showPermissionDialog('publish_stream', null, true); return false;">Permissions</a>

<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
            FB.init("APP_KEY", "xd_receiver.htm", { "reloadIfSessionStateChanged": true });
</script>

and your application will have permissions to post onto facebook page using code from my previous post

Facebook.Session.ConnectSession connectSession = new Facebook.Session.ConnectSession(_ApiKey, _ApplicationSecret);
Facebook.Rest.Api api = new Facebook.Rest.Api(connectSession);
System.Uri url = new Uri("http://timeMarker.org/");
api.Links.Post(PAGE_ID, url, "comment");