Showing posts with label facebook. Show all posts
Showing posts with label facebook. Show all posts

Tuesday, March 06, 2012

Facebook again–apps on fan page

How can I publish an app on a fan page?

Obviously you need to have admin rights on the destination page, then you can use this url:

https://www.facebook.com/dialog/pagetab?app_id=APP_ID&next=APP_URL

Substitute APP_ID with your app id (get it from the settings page on https://developers.facebook.com/apps) and insert the “Secure canvas url” (find it on the same settings page).

Then, if everything’s ok, you will be prompted with a list of pages; choose one and you’re done.

New Fan page look (“Timeline”)

After the switch to the new fanpages look and feel, I noticed that there is a limit on the number of apps that you can “pin” in the apps thumbnails list. The limit is 12 (three rows of 4 apps).

This is not a limit to the number of apps that a fan page can host; only a limit to the thumbnails list.

Monday, October 10, 2011

Facebook–how to set the height of your tab

Today I had to set to more than 800 pixels the height of my tab. I found here a simple solution, thanks a lot to Amit Jain.

Steps in brief:

  1. in the app “canvas settings” set the height to “Settable”, like in the image shown below.
  2. add to the <body> line: style="overflow: hidden" (to remove the scrollbars)
  3. add to your main <div> (the one that contains your html) the style: style="height:2000px; width:520px;" – obviously you will set your desired height
  4. finally, just below the <body> tag, add this code:

<div id="fb-root"></div> 
<script> 
  window.fbAsyncInit = function() { 
FB.Canvas.setAutoResize(); 
  }; 
  (function() { 
var e = document.createElement('script'); e.async = true; 
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
document.getElementById('fb-root').appendChild(e); 
  }()); 
</script>
 

that’s it – worked for me!

2011-10-10_1630

Friday, November 13, 2009

Facebook – wall post with Facebook Developer Toolkit, stream.publish

Just a c# sample that I find useful to have here – so that everybody around me can find it whenever needed :-)

public void Post(facebook.API fbAPI, string appLink)
{
    string response = fbAPI.stream.publish(
        " decided to go nuts.",
        new attachment()
        {
            name = "my application rocks",
            href = appLink,
            caption = "{*actor*}decided to go nuts.",
            description = "One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. http://indialimaalpha.blogspot.com/
",
            properties = new attachment_property()
            {
                category = new attachment_category() { text = "Take another action...", href = appLink }
            },
            media = new List<attachment_media>() {
                new attachment_media_image() { src = WebConfigurationManager.AppSettings["AbsolutePath"] + "images/go_joseki.jpg", href = appLink }
            }
        },
        new List<action_link>() {
            new action_link() { text = "Take Action!", href = appLink }
        },
        null,
        0);
}