Im looking for a way to customize the standard "Feed Dialog" screen the Graph API offers.
https://developers.facebook.com/docs/reference/dialogs/feed/
The idea is that the Feed Dialog matches the layout of my application and not the standard Facebook layout.
First thought was creating a seperate Dialog Box, which offers the same functionalities as the original box and passing that to the function which posts everything on the users wall.
But I am unable to find a way to implement the textarea, that gives Users the ability to enter aditional text to post.
Anyone who knows if this is possible and can point me in the right direction?
If you want your own interface for posting to facebook, don't use their dialog. Create your own form however you like, and then submit the information with
FB.api('/me/feed', 'post', { message: myMessage }, function(response) {
});
https://developers.facebook.com/docs/reference/javascript/FB.api/
Related
I am primarly ASP.NET(HTML,Js) programmer and I don't know anything about Fb apps. Recently I stumbled on a problem. I have web application that generates image buttons and generates code as HTML or Iframe for user to post on different websites, however as far as I know: It is not possible for user to embbed Iframe or post image wrapped with link to friends wall?
So before I start researching how to do anything on Facebook and go on wild goose chase, I just wanted to check with fellow programmers that might have experiences with this kind of stuff is it even possible to do this on Facebook?
If it is possible, can you give me some hints how the process goes or point me to some articles?
Any help is appreciated, thanks!
No, it is not possible to post iframes to a user's wall.
To be more specific, to post to a wall, we use Feed dialogs (with FB.ui), You can derive what you can and can't do from the list of parameters that FB.ui gets (scroll to "properties" in the feed dialog doc)
To show the "post to wall" dialog, you need to do something like this:
FB.ui({
method: 'feed',
link: "link",
picture: "picture",
name: "name",
caption: "caption",
description: "description"
}, callback);
I have put a like button on my web page which is dynamically linked to different Facebook fan pages. I have checked the insights pages of Facebook but it gives an overall count of button clicks from my site. Is there a way to get more detailed information like how many users clicked which Like button?
Facebook documentation mentions a ref tag that can be added to Like button code, however this tag does not show up in insights reports. Also I know I have the chance use JavaScript events to handle reporting personally, but I cannot since I am using iframe version of the button.
Also, is there a way for the Facebook fan page admin (the one that my like button links to) to see that detail exactly? e.g. "xx number of clicks generated with like button from this site (or app--which the like button is tied ?)"
In my opinion, Facebook insights are far from being complete.
If I where you, I would track like events, and visits from like using an analytic tools like Google Analytics. This is what I do for my website, and the website of the company I am working for.
However, Facebook insights can give you complementary metrics (age, gender...).
Regards
Antoine
As Antoine says, you can track your likes with Google Analytics. I don't know about insights though.
Here's more info on how to track likes with GA:
http://www.socialmediaexaminer.com/how-to-track-tweets-facebook-likes-and-more-with-google-analytics/
Use FB.Event.subscribe:
FB.Event.subscribe('edge.create',
function(response) {
alert('You liked the URL: ' + response);
}
);
Why use iframe if it is limiting you from doing what you need to do? Use XFBML or HTML5 versions and use the event handler to do an AJAX call to your server. Kinda like, Dr it hurts when I hit my thumb with a hammer, and the Dr says don't hit your thumb.
I am new to facebook API. I've integrated feed dialog successfully. I want to add some CSS to feed dialog. How can I load a FB feed dialog in a DIV tag so that I can add some text above the FB dialog. (For ex: text like share it with your friends... and some instructions)
To display the feed dialog I've used JavaScript SDK. Below is the code...
FB.ui({
method: 'feed',
name: 'Feed dialog',
link: 'http://testmysite.com',
display: 'iframe'
}function(response) {
if (response && response.post_id) {
alert("successful");
});
Any help would be appreciated.
Thanks
Facebook Dialogs are not customizable in this fashion. From Facebook's documentation (emphasis mine):
Dialogs provide a simple, consistent interface to display dialogs to users.
You might want to create your own dialog and use the appropriate Facebook Graph API calls to post to a user's feed.
You cannot style Facebook ui elements, such as the like button share button, ui dialog etc. You can only customize the ui through the parameters Facebook provides you. For the full list of parameters look https://developers.facebook.com/docs/reference/dialogs/feed/. A quick look, and I dont think you can customize the text on the ui dialog.
Hope this helps,
Tyrone
On the facebook page,we can click the like button to like the page.
How can we use any api or plugin to realize from other site?
You can not automatically like an object for a user nor can you present like via the APIs. This prevents anyone "secretly" having users like pages / objects.
The solution is to embed a like button to your page and give users a clear reason to use it [sell the benefit of liking your page]. You can run a separate version for individual pages, objects or just an aggregate button for all of your site via the data-href element.
http://developers.facebook.com/docs/reference/plugins/like/
You can check if a user has liked your page using:
FB.api('/me/likes', function(response) {
console.log(response);
});
Loop through the response and look for your page ID.
The open-graph api has now been updated to support creating (and deleting) likes.
See here:
https://developers.facebook.com/docs/opengraph/actions/builtin/likes/
writing my first facebook webapp and i have some questions. I'm using their new Graph API + JS library.
The idea is that in order to use my webapp, user has to 'Like' facebook page A.
Suppose user is logged in. I have to check if he 'likes' page A. If user doesn't like that page, i display 'fan box' via
FB.XFBML.parse('<fb:fan profile_id="A's id" stream="0" connections="0" width="450"></fb:fan>');
Now, this fan box with 'Like' button is rendered in iframe that has src set to facebook domain.
Problem: i want to know when user clicks on 'Like' button so that i can display the rest of my webapp. The only possible solution that i can think of is polling every second facebook graph server which is really bad.
i can't attach 'onClick' event on that button cause it's inside iframe pointed to facebook domain (can't access it at all using JS)
i tried getting the contents of this iframe from my server and display it in iframe with empty src property so that i can access its elements - doesn't work, fan box is messed up.
There is no way that i know of to send 'i want to like that page' request to Graph server on behalf of the user.
I'm stumped. I really doubt that polling is the right way to solve this problem :)
You can get the onclick event by using the fbml code of like button instead of iframe code.
Facebook provides FB.event.subscribe which triggers when somebody clicks like button.
A complete tutorial is here.In your case you can write the code to refresh the page on like button click. and check for like condition on page load. so that if current user has liked the page you can redirect him to application page.