Group page not showing some members name from Graph API - facebook

Could someone explain to me why a few of my members from my group page have blank data for their names but their Facebook ID shows up just fine?
An example of what I am talking about would be:
<user>
<id>xxxxxxxx</id>
<name>Bobby Bushay</name>
</user>
And the ones that show the fb id but not the name look like this:
<user>
<id>xxxxxxxxxxxx</id>
<name> </name>
</user>
So I figure it has something to do with their privacy settings maybe? If so, where would I need to direct them in order to change that privacy setting so it can be read? Oddly enough though when I am using the Facebook Graph API Explorer and I click on their ID it gives me all their info including their first and last name?

What happens if you go to the User's profile page? E.g. facebook.com/{profile_id}
Its could be that those users are preventing their information being shared to the group / or members of it.
Ask the user to edit the How people bring your info to apps they use settings on their account, found under Privacy Settings > Apps, games and websites. Maybe that will make a difference. In particular, check if the Bio checkbox is checked.

Related

Callback from Facebook app as a tab app on multiple pages

Salon owners can create an account with their salon information on our platform and they get a page that they can use as a tab app.
I want to be able to serve all these pages from one app instead of having to install each one seprately and I also want to make the life of the salon owner easier by helping them to install the tab.
I know about the link I can create to help them install the app and I know that when a visitor visits the app that facebook will send the page ID. So far so good.
https://developers.facebook.com/docs/appsonfacebook/pagetabs/
But how do I make sure that when the salonowner follows the link to install the app that I get the page ID back (through callback or other) so that I can register which page ID belongs to which salon account.
I've read sone 2011 article about a callback but I can't find any recent info on this.
I think it should be possible as a lot of sites offer easy fb apps to businesses.
Any help would be welcome!
EDIT: Could this last piece of info in the Facebook link above be used to do this? I don't quite get it yet.
In addition, your app will also receive a string parameter called app_data as part of signed_request if an app_data parameter was set in the original query string in the URL your tab is loaded on. It could look like this: "https://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here". You can use that to customize the content you render if you control the generation of the link.
Well... Preventing users from adding your application to their page is impossible. You can't prevent that.
What you will be able to do is to detect who has added your application and according to that, change the content (or not display it at all). So you'll have to start with a list of "allowed" page_ids to match to the accounts you want.
Your application will receive a signed_request each time a user arrives at your application (within a page). Inside that signed_request is information not only on the user but also on the page that the application is on (provided it is a page tab app).
Once you have obtained the signed_request, it will hold a page key which contains:
A JSON object containing the page id string, the liked boolean (set to
true if the user has liked the page, false if not) and the admin
boolean (set to true if the user is an admin of the page, false if
they're not). This field is only present if your app is being loaded
within a Page Tab.
So you'll be able to access the page_id from within this variable and make a decision on the type of content you want to be displayed.
Ok, after running some tests I found out that when you add a URL as 'next' parameter to the install URL Facebook will send the admin(user) back to this URL while adding an array to the request containing all the page Id's the app was installed to.
Like this: YOUR_CALLBACK_URL?tabs_added[ID]=1
Proved to be quite easy in the end

Including captions in app generated images

I am having a doubt regarding the Facebook policies. It is being stated that:
IV. Application Integration Points
.....
You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content
earlier in the workflow: Stream stories (user_message parameter for
Facebook.streamPublish and FB.Connect.streamPublish, and message
parameter for stream.publish), Photos (caption), Videos (description),
Notes (title and content), Links (comment), and Jabber/XMPP.
.....
Source: https://developers.facebook.com/policy/
And from the examples & explanation page, it says the following for Photos:
You must not pre-fill Photo captions unless the user manually
generated the content earlier in the workflow. These fields are
intended for users to express themselves. Pre-filling these fields
erodes the authenticity of the user voice.
So, my question is: I have seen 99% of the apps (that I used), is auto-filling caption field for photos with say, something like: You can try it by visiting here: http://www.apps.blahblah.com/appname
Isn't that against the facebook policy ? Or they are not flagged because they are using the extended permissions(publish_stream) instead of the post_actions ?
If it is not allowed for both the permissions, then my next question is, how would we tell the users viewing the photo, the link to the app so that these audiences can also try the app ?
Also, if possible, I would like to see a small example of the caption that would be generated in the workflow as mentioned here in the policies: ...You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow....
Thanks in advance.
It is against policies, but many apps do it nevertheless.
I think a compromise would be to have the user enter their own message, and then just append a little link to the end of that before posting it.
As for the example, what exactly would you like to know/see? You have the user put in a message through a text field/input box/whatever, and set that as the message while posting the image.
Currently its forbidden. User should fill the whole caption text. Adding anything to it also is also forbidden.
You can watch the Facebook policy video about pre-filling here:
https://developers.facebook.com/docs/apps/review/prefill

How to find Facebook group id by name

I have a Facebook application, which I would like to be able to read facebook group feeds.
I have a user-input feed url, that looks like this: http://www.facebook.com/groups/music.sharing/
To access the feed though, I can only use its id, like this: http://graph.facebook.com/[id of group]/feed
I cannot find anything for that in the reference, FQL doesn't allow querying by name so .. I'm stuck. Any ideas ?
Thanks!
Its not possible right now, there are multiple open "bugs" and another stating the issue...
All the ways I have tried have failed... e.g. (below would work for pages)
fql?q=select id from profile where username='music.sharing'
We are facing this same problem on our current project. It is not an elegant solution that uses the API, but for now we will be using a workaround by scraping the HTML of the group landing page. The group ID number appears four times on this page in the html via links. The most reliable way to search for the ID is to search for "cid=" as it only appears once (right now, anyway) on the page (what follows cid= is the numerical ID). You'll see what I mean when you examine the html of a group page.
If you found a more efficient solution, I'd be grateful if you shared :)
A possible alternative until bug resolution could be: if you are asking your users for permissions then you can ask for the additional permission, user_groups, and then query graph api http://graph.facebook.com/[id of user]/groups. The returned data has group name, id, version, bookmark_order.

Expressionengine 2 Login screen on Front Page

I would like to create a login screen for registered members on front page of the site without using members module. As I can see I can create a member and assign login credentials at back-end ( I don't have member module). Basically the idea is:
visiting: www.domain.com will give you login screen. When logged in it will redirect you or open new page.
I'm not looking to buy a module or extension. If something already exist I will be happy to use it.
Can anyone help?
You "don't have the members module"? How is that possible - it comes with the default install! So, something does already exist - it's called the Login Form tag.
So is the question how to create a login form on the front end of the site, or how to keep non-logged in users from viewing a specific template?
If it's the latter you can set access privileges at the template level. Look for the "Access" link by each template in the Template Manager, click that and you'll see your member groups and an option for what template to display if they aren't logged in. Typically that's a login template using the Login Form tags mentioned earlier.

Fetch a group object with Graph API using group alias?

How can i fetch data with group page alias ?
Take for example this group: http://www.facebook.com/groups/toroneradio/.
Making request to https://graph.facebook.com/toroneradio gives me back:
"message": "(#803) Some of the aliases you requested do not exist: toroneradio"
Making request to the graph API with the group's id: https://graph.facebook.com/173246339390721 works OK.
It works great for pages though.
Looked at FQL groups table but name is not searchable. (FQL Groups table)
Also looked for some documentation and in FB bugtracking, couldn't find anything.
Is there way to get programaticly the group id from group alias or directly to get Group graph object?
Thanks, in advance!
The Easy Way
If you haven't done so, join the Facebook group which you want to fetch the group ID
Use the Facebook Graph API explorer
Access your list of groups via http://graph.facebook.com/me/groups
Search for the group and the ID will be listed in the object
If you are doing it through your Facebook application, all you need is to grab an FB access token before you do the FB Graph API call (read up the documentation here, especially the Authorization section)
The Hard Way
In case the easy way doesn't work (or if you feel iffy in joining the group), here's the sure-fire way to do so:
Start up Firebug and enable the "Net" tab
Bring up Facebook - check that the Net panl will show all the HTTP requests that's happening
Click the "Clear" button so that you have the panel in the blank slate
Click on the link of the Facebook group that you wanted to retrieve the Facebook ID
Look out for a GET request to generic.php - that would be the very first request, but hunt it down if it's not. Click on the [+] box to expand the details
Click on the "Parameters" tab and you'd see a key-value dictionary of the request. There'll be two fields in there called "key" and "sk", both of which would carry the same value like "group_1656399367890"
The group's ID will be the numeric value after "group_" (in this case, it'll be 1656399367890)
Hope that helps!
By using FQL:
SELECT id FROM profile WHERE username='groupname' AND type='group'
Just figured this out! Do this: http://graph.facebook.com/search?q=[ALIAS]&type=group