Facebook React Native SDK login button too small - facebook

The default login button for Facebook's React Native SDK isn't rendering all of the text "Continue with Facebook" and instead it cuts off at the "k" in Facebook. It seems like the container needs to be tad larger to render the logo and entire text. After logging in, the text "Log out" fits fine.
I know that this button can be customized, but this should be fine out of the box. Any idea how to resolve this?

Related

Mobile Safari submit with enter key

I am using an iPad with a bluetooth keyboard and am having some troubles. I basically have a website that after tapping search, pops up with a modal. The modal contains a summary of information & two buttons - a cancel and a print. My hope is to have the "Enter" key mean the user clicked on the "Print" button. I've tried going the javascript route with click triggers and such, and I've also tried making it into a form with a submit button but mobile safari likes neither. It seems like it requires that I touch the screen again before pressing enter to work. Any ideas would be greatly appreciated..

Send button not displaying in my web page

I tried with HTML5 as well as XFBML version also but send button not appearing on my webpage.
I used the code from https://developers.facebook.com/docs/reference/plugins/send/ for http://www.rakthadanam.com. On the developers.facebook.com it is showing properly but on my site it's not displaying.
Well, that´s because you cut it from the Social Plugin. There is just no space for it right next to the like button, you are going to have to make it bigger.
Also, there is "send=false" in the source code, so of course there is no send button at all.

How to trigger Facebook like button from custom button?

I have created a custom Facebook like button.
How do make it that when I click the button, it will trigger the like button provided by Facebook like the one below?
According to facebook policy on Social Plugins point 4 states:
"Don’t obscure or cover elements of social plugins."
You can't change the image directly because it's provided by Facebook.
The Facebook button is in an iFrame with a source that is on a different domain, Facebook’s domain, and so you can't change the button as it's protected by the same-origin policy.
Also, Facebook’s policy prohibits changing their buttons and logos when using embedded content from Facebook, like social buttons.
So, you're not suppose to be able to change the FB buttons, and even if you could it would be against the Facebook Terms of Service.
But... if you still want to do it, you can use the native Facebook button and lay your own image on top or below the Facebook button to fake a custom button.
Laying your image on top is only possible if you use CSS3 pointer-events, wich will make your image click-through and the click event will work "through" your image and actually click the Facebook button.
This only works in newer browsers that support Pointer Events.
Another option is to lay the image behind the FB button and set the FB button's opacity to zero.
I have used this several times myself, and with a little digging around in the Facebook code you can attach hover events and everything else to make it look like a custom button. You would have to find what elements to set opacity : 0 on.
Have never spent any time trying to figure out how to make the unlike function of the original button work on a custom button, but it's probably possible.
All my attempts to actually trigger the FB button with javascript or jQuery trigger() have failed, but maybe someone else has figured out how to do it?
When you create a html element with fb-like class, facebook javascript SDK convert it with a like button when document loaded. You can make a custom element and trigger click event of like button when user click your custom button.
For example :
<input type="button" id="mycustombutton" value="Like">
<div style="display:none" class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
jQuery code:
$("#mycustombutton").click(function(){
$(".fb-like").find("a.connect_widget_like_button").click();
// You can look elements in facebook like button with firebug or developer tools.
});
Update
Facebook SDK has been creating like button in an iframe and browsers not allowing to intervention to the iframe in the page. I think add event listener to element in iframe does not possible anymore.
This is not allowed for the obvious reason that it would lead to fraud. Imagine if each time you clicked an image on the web you don't know if it's an actual image or if it will result in a like and show up in your FB feed. It would be disastrous.
If you do want to do this legitimately, you will need to create an app and have the user authorise the app when he visits your site. This will open a popup where the user agreed to let the app access his FB account. Once that is done you can then send the like request on behalf of the user via a server-side script. In other words, it's not worth the effort.
If on the other hand you just want to get the like count for a page and display it however you want, you can do so via a request to "http://graph.facebook.com/#{url}" which will return a JSON payload with the number of likes. In jQuery it would be:
$.getJSON("http://graph.facebook.com/#{url}", function(data) { alert(data.shares); });
I think that facebook goes through great lengths to make sure people can't trigger the "Like" button. This is to prevent scripts from automatically clicking the "Like" button when someone visits the site.
You may be able to override the style of it using CSS and have your image show instead.
You can overlay your button on top of the Facebook like button and use css to hide the Facebook button.
Not sure on the legalities of this however.
You could try to trigger an Ajax request like this
FB.api(
'me/og.likes',
'post',
{
object: "http://samples.ogp.me/226075010839791"
},
function(response) {
// handle the response
}
);
https://developers.facebook.com/docs/reference/opengraph/action-type/og.likes
http://sharingbuttons.io/ allows to make social media share buttons with no javascript at all (Not a like button like in the question…). For Facebook, it just uses a link like this:
<a href="https://facebook.com/sharer/sharer.php?u=http%3A%2F%2Fsharingbuttons.io"
target="_blank" aria-label="Share on Facebook">Share on Facebook </a><br>Here on Stackoverflow, you have to cmd + click to open the link in a new window.
Customize it with your own CSS and, to mimic the share button, just open the url in a popup instead of a target="_blank".

Facebook Like button with thumb up icon?

As you already know from this link http://developers.facebook.com/docs/reference/plugins/like/ you may create Facebook Like button. But...
When I choose 'layout style' to something else than 'standard', little 'thumb up' icon inside button is changed to Facebook logo.
Is there a way to have 'layout style' set to 'box_count' and to little 'thumb up' icon remain inside button?
Nope, there isn't. What you see is what you get for those social plugins Facebook has designed.
However, you can log a bug (and have it marked as a wishlist item) about this at http://developers.facebook.com/bugs.

Facebook iframe app with fullscreen popup?

With a Facebook iframe canvas app, is there any way to launch a modal pop-up (such as when clicking to magnify a photo, similar to http://fancybox.net/) that extends outside the bounds of the iframe's width? I'm thinking there would have to be some sort of communication with the _parent, but I'm not sure what's allowed or how to approach this.
In short, you can't.
Your application lives within an iframe within Facebook. You can't alter Facebook's code outside the frame (against their policy).
You can pop up a new browser window in full screen, if you'd like. But I'd question that as far as user experience goes.