Proper age restriction for facebook applications - facebook-graph-api

I have tried to implement the age restrictions by using a post request on the graph:
https://graph.facebook.com/[APP_ID]?restrictions={"age_distribution":"18+"}&method=post&access_token=[FUNKYFIED_ACCESS_TOKEN]
This sets the restriction to 18, however when a user hides the year when he/she was born the user will never pass the age restriction... I understand that the graph won't return the birthday when a user has hidden his/her birthday/birthyear. But why won't facebook allow the user through the restriction?
Is there any other method on doing this?

Perhaps your app could request the user's birthday in the permissions and you can do a calculation based on that but that just gives you the same problems - not everyone will have entered their DOB on Facebook.
Only other thing I can suggest is take a look at some other pages and see how they do it, some good examples might be the Fan pages of alcoholic beverages.

Related

Facebook API - Top 5 users for engagement and likes on fb page

I am trying to construct a Top 5 of engaged users and users that liked something on my Facebook page(a non-profit)(for instance posts, links or images). It has to be an aggregated total of engagement and likes for all items on the page per user.
Can anybody provide with some clues as to which Facebook API calls I could use for this. At this moment I am only capable of determining which users liked the page, or a particular post.
If the question is too general or anything else, I'll gladly modify it. I would have liked to attach image for clarification, but is not a possibility for me yet due to reputation score.
The only way to do this is to get all likes/comments/whatever from every single post with the API, store the numbers in your database and compare User IDs. You would have to keep it up to date too, so you would need to refresh your database entries from time to time.

Facebook API get friend albums not working for some friends

I'm using the following FQL query
'select src,src_big from photo where aid in(select aid from album where owner=' + contactId + ' and type="profile")'
But it works for about 50% of my friends, and the rest - it doesn't.
Its not a permissions problem because the behavior persists per friend, if it works for a friend - it always works for him.
Is this a Facebook thing, where a user can choose to prevent apps from getting his photos?
(like what happens when some friends are missing from /me/friends )
It will be odd, because it doesn't work for too many friends..
I tried the same with the graph API, and the same happens (some users ok, rest are not)
What is this?
Thanks in advance
Take a look at the Profile settings of your account. Do you see the Apps link on the left?
There's on portion there that says "Apps others use"
People on Facebook who can see your info can bring it with them when they use apps. This makes their experience better and more social. Use the settings below to control the categories of information that people can bring with them when they use apps, games and websites.
Bio
My videos
Birthday
My links
Family and relationships
My notes
Interested in
Hometown
Religious and political views
Current city
My website
Education and work
If I'm online
Activities, interests, things I like
My status updates
My app activity
My photos
If you don't want apps and websites to access other categories of information (like your friend list, gender or info you've made public), you can turn off all Platform apps. But remember, you will not be able to use any games or apps yourself.
If your friends have that checked. I believe apps won't be able to get your friends' images through your access_tokens even if you have allowed the "friends_photos" permission enabled for the app that you're using.
I did an experiment and apparently I found that I must get my friend to also access the app to allow the app to access their photos under the "user_photos" permission. only then can I get their photos using my access token with the "friends_photos" permission.
Not sure if this makes sense to you.

Facebook Profile Pictures for non-Friends

I am creating an iPhone email client that displays sender's profile pictures in in the UITableViewCells in the inbox, much like Sparrow does. I am using the following FQL query to grab these images:
SELECT
pic_big
FROM
user
WHERE
uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
AND
strpos(lower(name),'INSERT_FIRST_THREE_LETTERS_OF_FIRST_NAME_HERE') >= 0
AND
strpos(lower(name),'INSERT_LAST_NAME_HERE') >= 0
ORDER BY name
I get the names of the senders from the email headers, and then search the user's Facebook friends using the full last name and the first three letters of the first name to account for nicknames. This works pretty well on the whole.
Sparrow, however, is able to grab profile pictures from Facebook for users I am not even friends with. How is this possible? I though queries were limited to specific groups, like your friends. And that searches for email addresses were not valid? Is this correct? How does Sparrow grab these profile pics?
Well as long as you know the users Facebook ID - it's a long number but treat it as a string. You can use this url to get their profile picture:
https://graph.facebook.com/[id]/picture
No need for anything more complex.
You can get the user_id of any known user from their email by making an API call to:
/search?type=user&q=USER#EMAIL.NET
If their email is registered with Facebook and public, you'll get back a JSON object with their name and user id. You'll need to make a separate call (or use a batch request) to get their picture from their ID.

Facebook limit per user, per day : 50

Hi I have a facebook quiz application. When a user comes to the app then he will see questions about his/her friend. Now once user answer or clicks yes/no the app will make publish to his friend's wall.
No when I see in application >> insight >> diagonastic I can see user limit
limit per user, per day : 50
Now my question is if my application has 5000 daily visitors and each user posts 10 answers to their friends' wall then my app will be deleted by facebook? Is there any way to track or limit postings?
Thanks
No, you don't need to worry about app banning, because that after the limit, every post your application makes will results in an error from Facebook ("post limit exceed", something like that). But still be careful because if you post too much, very likely users will report your application as spam, and it may get banned.
To track limit postings, you can simply write your own trackings (record to database when user request to post, for example).

email id of user from new facebook API

I have worked earlier on facebook API. I successfully used it and fetched all friend lists with their email ids. I was also able to get user email id who logged in through facebook API.
Now in gap of 7-8 months I found that faceAPI development section has been changed . New one is something different.
And now I am facing problem to get email id after user login at facebook.Yet all other details are coming like user name .user id and location except email id.
Old script is also not working with me. Could you help me to get email id of user who get login by facebook at my website.
Thanks for your cooperation.
No one will do your homework (upgrade the code for you)
Read the most current documentation
Accessing users e-mails require a special permission email
Users may choose not sharing their direct e-mail with you
You didn't say what technology you are using, but you can check the PHP-SDK example page to get started.
Direct Access Method:
Log into Facebook under your name. If you need an "Access Token", Click on the Extended Permissions and click the "read_friendlist" check box to get your Access Token and then
submit your query. You may need to "Allow" access, so just follow the prompts given.
Voila! You now have the usernames for everyone on your Friends List. The "username" parameter in the query will give you the contact email "message to that person" and you append #facebook.com and send them a message. Very simple.
http://developers.facebook.com/tools/explorer?fql=SELECT%20username%20FROM%20user%20WHERE%20uid%20IN%20%28SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20%3D%20me%28%29%29%20ORDER%20BY%20name
I had been using the import function in Yahoo Mail but now it has been limited to the first 50 names on your friends list. Where I work, they have over 6,000 friends between the two pages. This is a very simple solution to my problem. And now I can write a very small PHP sendmail program and send EVERYONE on the friends list an email message that goes directly to their messages. No more viewing page sources or manually doing this.
I can create a special email list on IFanz that will handle all dups, even if I repeat this process on a monthly basis to acquire new emails.
-SAB