Facebook like button status update - facebook

i have a like button and a log in button on the same page. the page is outside of a Facebook iframe. if i am not logged in and log in through the log in button the like button status doesn't get updated. but if i'm not logged in and log in via the like button the log in button gets updated. from what i can tell the like button doesn't seem to be able to receive the updates when window.fbAsyncInit is fired off.
is there a way to update the like button when i log in through a different Facebook button on the page?

Here's a work-around.
Subscribing to the auth.statusChange (http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/) and check to see if it is a sucessful login. If so, re-render the like button code into your DOM and then have the Javascript SDK re-parse it using FB.XFBL.parse() (http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/)

Related

Disable Facebook Pixel code on specific button click events

Having trouble with Pixel code. I have button click event which fetches data on ajax calls. The problem is that facebook button click event SubscribedButtonClick is also triggered which interferes with the ajax call failing any response from the server.
I have looked into their API but did not get anything helpful. Is there any setting or code which can help to bypass this button click event or disable the SubscribedButtonClick call on specific button clicks?
It is possible to disable automatic SubscribedButtonClick and MicroData tracking events:
fbq('set', 'autoConfig', false, 'FB_PIXEL_ID')

Facebook like button on Apache Cordova/Phonegap app

I have inserted a facebook like button with this methods like a simple web:
https://developers.facebook.com/docs/plugins/like-button
But the first time that a button is pressed a login window opens. This window opens in the current window, not in a new window. After the user logs in the window try to close itself but it can't. A white window is showed.
Next times the like button works correctly because the user is logged in.
I also try to implement with the cordova plugin "phonegap-facebook-plugin" but it doesn't have support for like button.
https://github.com/phonegap/phonegap-facebook-plugin
I think you need to listen to when they've finished logging in and redirect back to you're application some like this.
Only with window.location set to something like file:///android_asset/www/index.html or whatever page you want to return the user to.
<fb:login-button onlogin="document.location.href='file:///android_asset/www/index.html';">
</fb:login-button>
Something like this but for the like button ?

Facebook login button custom text changing after logout

I have application where i have put custom text "Connect". on fb-login button but after fb logout. it gets changed to "Log In" rather than "Connect".
Connect
any resolution for it.
You can use the FB.getLoginStatus to set the button InnerText to Connect or Log In which ever you want...

Facebook-like button as an overlay to have cross-network liking?

I have a page that allows users to "like" certain elements. The liking is similar to a facebook-like, but for various reasons (such as being able to easily manipulate the data), the liking is for users of my site, and not necessarily for facebook users, and the data remains on my site. So there is a "mysite-like" button. However, I'd like it if this mysite-like button also functioned as a facebook-like button, and if a person is logged onto facebook, it would post it on their wall.
Is there a way to make a button which performs both functions? E.g. perhaps by having an invisible facebook-like button, overlayed on top of the mysite-like button? Perhaps through some opacity=0 iframe? In an ideal world, clicking on one button would function as a mysite-like, and also a facebook-like, and a google+1. One button to rule them all...
The clean way to do this kind of implementation, where user interaction on a social button triggers changes on your site, is to use the callback methods.
Limitation
These callbacks work in one direction. For example:
Facebook Like button -> your custom 'like' button
OR
Google +1 button -> your custom 'like' button
As a result you will not be able to
trigger either of them from your custom 'like' button
trigger one third party button from the other
And now that you know what you can do with them, here's how to do it.
Facebook Like button callback (from another StackOverflow post)
<script>
FB.Event.subscribe('edge.create', function(href, widget) {
alert('You just liked the page!');
// this is where you would trigger your site specific logic
});
</script>
Google +1 button callback (from the official docs)
<g:plusone callback="myCallback"></g:plusone>
<script>
function myCallback(result) {
alert('button was just changed to state ' + result['state']);
// this is where you would trigger your site specific logic
}
</script>
One way is to have the facebook-like button also trigger a "mysite-like" action e.g. via http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/
Is there a way to do this also with google+? You can use the callback option https://developers.google.com/+/plugins/+1button/#plusonetag-parameters but not sure how to get the userid of the user.

Multiple Facebook Like buttons referring same page

I have a page with like button assigned to it. I have some textual contexts on this page, I want to put a Facebook Like button under each text (I do not have different url for each text para on this page).
I want the count to be updated for the page also as user clicks on Like button under any text.
If you can tell me how to hide count near the Like button then also my problem is resolved.
Example: http://www.santabanta.com/trivia.asp?sms=1&catid=1
You could subscribe to edge.create event and reload the buttons after a user clicks like.