I am implementing a Facebook registration page for my site using iframe, as follows:
<iframe src="https://www.facebook.com/plugins/registration?
client_id=<%= FACEBOOK_CONFIG['app_id'].to_s %>&
redirect_uri=<%= FULL_ROOT.to_s %>&
fields=name,first_name,last_name,gender,email"
scrolling="auto"
frameborder="no"
style="border:none"
allowTransparency="true"
width="100%"
height="100%"
data-scope="email">
</iframe>
I am using rails.
When the user clicks on register, he is redirected to the correct page UNLESS I include his email and birthdate, in which case I get:
Request URL:https://www.facebook.com/ajax/connect/registration_widget.php
Request Method:POST
Status Code:500 OK
Request Headersview source
:host:www.facebook.com
:method:POST
:path:/ajax/connect/registration_widget.php
:scheme:https
:version:HTTP/1.1
accept:*/*
accept-encoding:gzip,deflate,sdch
accept-language:en-US,en;q=0.8
content-length:758
content-type:application/x-www-form-urlencoded
etc.
Clearly this has to do with the fact that the user's birthday and email aren't part of his public profile.
i tried requesting these permissions (Added them to my app settings on Facebook) but nothing works.
I need to crack this: how can I register the user, including his e-mail and birthday?
Thanks!
This turns out to have been a Facebook bug that was resolved yesterday.
Still hoping for my $500!
Related
I wonder if someone may be able to help.
Recently, we realised we had to get consent for using the Facebook pixel on our site. I have looked at the developer information on Facebook on how to do this, and I can stop the pixel from sending data to Facebook...
What I need help with is allowing the data to be sent if the visitor accepts the cookies in the BigCommerce cookie bar (say for either the analytics or Targeting; Advertising category) ... the code I have so far in script manager to stop sending the data is this (to note I removed our FB pixel ID and replaced with 0's for this example) I tried to connect it to the BigCommerce cookie banner but failed (I was trying to use tag manager but this failed also):
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('consent', 'revoke');
fbq('init', '000000000000000');
fbq('track', 'PageView');
</script>
<!-- End Facebook Pixel Code -->
As you can see I added the fbq('consent', 'revoke'); to the code
More info from Facebook here regarding the codes to use: https://developers.facebook.com/docs/facebook-pixel/implementation/gdpr/
Thank you for any help you can offer with this 😃 our site is https://www.wolftucker.co.uk
The BigCommerce consent banner sets a cookie (bc_consent) with details on what the user has consented to. You can use that to decide if you need to do the revoke command.
Alternatively you can add your code using the script manager and set the script category to "Targeting; Advertising". This will remove the script if consent is not given.
Currently, our app posts to users' friends' walls via Graph API. However, Facebook is deprecating this functionality so we are migrating to the Feed Dialog per Facebook's recommendations (see the February 6, 2013 section at https://developers.facebook.com/roadmap/).
Now, we know we can specify the recipient as part of the Javascript SDK call (note FB.init() is called elsewhere earlier on the page):
<p><a onclick="launchFeedDialog(); return false">Testing the Feed Dialog</a></p>
<script>
function launchFeedDialog() {
// calling the API ...
var obj = {
method: 'feed',
to: 'RECIPIENT NAME', // Can specify recipient here
link: 'http://example.com',
name: 'Test post',
description: 'Test description'
};
FB.ui(obj);
}
</script>
However, it does not seem like the user can modify the recipient in the launched dialog. A screenshot of what I mean is at http://i.imgur.com/oLPTO.png.
Is there some way of invoking the Feed Dialog so that the user can change/add recipients, like in the Send Dialog?
The flow we are trying to implement (and the way it currently is) is:
User clicks a button to launch the Feed dialog
User fills in the Feed dialog (including recipient) and submits
Right now, we are stuck with this awkward flow:
User fills out a custom control specifying the recipient
User clicks a button to launch the Feed dialog
User fills in the Feed dialog and submits
OK, we found a workaround. The general idea:
Display the Feed Dialog inline as an iframe (by specifying display=iframe)
Create your own custom control for selecting a recipient Facebook username or id
Reload the iframe asynchronously upon selecting a recipient or onblur, etc
Some caveats/reasoning for above:
You can't use the JS SDK because it will launch the iframe version of the Feed Dialog as a modal lightbox (rather than inline in your page flow)
You'll need to implement a redirect page that does post processing, such as updating the state of the parent window, logging results, etc
For (2), the custom control can be as simple as a text input field, but you'll probably want at least some sort of autocomplete. This is actually not too tricky, as you grab your user's friend list with the https://graph.facebook.com/me/friends Graph API call.
Here's a basic example using a simple text input:
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<div>
Recipient's FB username:
<input type="text" id="fb-recipient" placeholder="Recipient's FB username"></input>
<input type="submit" id="fb-recipient-submit" value="Pick" />
</div>
<iframe id="fb-feed-dialog" width="586" height="330" frameborder="0" allowfullscreen></iframe>
<script>
$('#fb-recipient-submit').click(function(e){
e.preventDefault();
var feedUrl = 'https://www.facebook.com/dialog/feed?';
feedUrl += 'display=iframe';
feedUrl += '&app_id=' + 'YOUR_APP_ID';
feedUrl += '&access_token=' + 'ACCESS_TOKEN';
feedUrl += '&link=' + 'SHARE_LINK';
feedUrl += '&redirect_uri=' + 'REDIRECT_URI';
feedUrl += '&to=' + $('#fb-recipient').val();
$('#fb-feed-dialog').attr( 'src', feedUrl );
});
</script>
</body>
</html>
You can find a screenshot of a slightly more fleshed out solution at: http://i.imgur.com/0jTM391.png
I am working on a Joomla site and using myApi to handle most facebook integrations. The like button is working fine and picking up information from the og meta tags inserted by myApi.
On the website, the user can login using facebook - I have added the publish_actions permission to the myApi code, and I know this is being requested because when authorising the app, the oauth dialog says that actions like ordering from restaurants (the action i added to my fb app) will be posted to the timeline.
now, while ordering, I check whether the user has an entry in the myApi user table and if so, I provide a checkbox that lets the customer choose whether she wants the order action posted to her timeline. if ticked, I then use curl to try and post the order action to facebook. I have been using my account to test - I have authorised the app with all permissions requested. I use the myApi interface to get my user access token. I am adding the access_token and object url to the url as querystring parameters and then posting to it through curl.
The curl response I get is:
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY></HTML>
the response I get when going to the generated url in my browser is
{
"data": [
],
"paging":{
"next": "https://graph.facebook.com/me/og_collegekhana:order_from?restaurant=http\u00253A\u00252F\u00252Fwww.collegekhana.com\u00252Fstates\u00252Ftamil-nadu\u00252Fcampus-1\u00252Feat-1&access_token=[the token I got]&offset=25&limit=25"
}
}
I checked the object id of the url using
https://graph.facebook.com/?ids=http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1
I am not getting an object id. instead I get
{
"http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1": {
"id": "http://www.collegekhana.com/states/tamil-nadu/campus-1/eat-1"
}
}
I am completely lost and hope someone can tell me what I am doing wrong.
The problem was that instead of doing a cURL POST, one has to add the querystring parameter
method=post to the URL.
Anyone seen this error?
I am using the following javascript to connect to facebook..
$("#fbsignin").click(function(){
FB.login(function(response) {
if (response.session) {
$('#fb_signin').submit();
} else {
// $('#fb_authfail').click();
}
}, {perms: 'email,user_location,publish_stream'});
});
Chrome, Safari and Firefox work great. IE 7 & 8 work as well as long as I am logged into facebook in another tab/window. If I don't have a FB session and if I am required to enter the email/password in the FB pop, then I just get an error which says "An error occured". I can close that window and try authenticating again and it works. I searched through the questions and
I have the <div id="fb-root"></div> right after the <body> tag.
It could be a P3P issue. People have found in the past that if the correct P3P headers are not sent, Internet Explorer will ignore any cookies it receives. Its an irritating and undocumented problem.
For PHP, include this at the start of your script (before any output):
header('P3P: CP="CAO PSA OUR"');
For Apache (or a .htaccess file), include:
Header set P3P "CP=\"CAO PSA OUR\""
(note that the above directive is untested, if someone could verify, that'd be great.)
From what I see now, it seems that the plugin provides me only authenticated facebook user's email address.I need the first name, last name, and other data.
With my plugin (few month ago) the facebook_connect setting in app.yml did not work.
So, I've put this for the fb login button :
<img src="/images/fb_dark_medium_short.gif" alt="Facebook Connect" style="width:100px"/>
You can add in the scope GET parameter your permissions.
Hope this can help
by setting:
facebook_connect:
user_permissions: []
you can request some of those permission: http://developers.facebook.com/docs/authentication/permissions/