Foursquare style facebook invite over Graph API - php

I want to allow newly signed up users to be able to do a facebook connect and select some of their friends and dispatch an invite to them for my website.
I saw this in action when I signed up for foursquare, I believe they are using the Graph API in a particular way to achieve this.
What approach should I take to get to similar results?
I am using PHP and Javascript.

You are not allowed to send messages to friends of a user who authorized you via Facebook.
The Graph API does not allow this.
Foursquare only allows linking between people who are buddies on Facebook AND already have authorized the Foursquare application.
The process is :
A and B are Facebook friends.
A authorized foursquare (FS for short) app - FS has their email and facebook ID.
B authorized foursquare (without any relation to A) - FS has their email and facebook ID.
FS looks up B's contacts, and cross-references the list of those facebook ID's with ID's of all the people who signed up to FB via facebook.
Result : list of people who are Facebook buddies of B AND have authorized FS app on facebook.
Since FS already has A's email - they can send the request via email.

Related

facebook php graph api me/friend reture nothing

hi I'm a facebook api php developer. I developed some apps with me/friend . now this return friends only for my admin account. when another user use this app, it retune nothing.
why this return friends only for my admin account.
if should I get special permission how can I get it.
could you any one please help me.
Make app live
You need to make the app and all its live features available to the general public. This can be done by making the app live by going to https://developers.facebook.com, select Apps --> Your App Name --> 'Status & Review'.
Login Review
You might need to do a Login review.
Review is not required to ask for the three basic permissions: public_profile, user_friends and email. In order to use Facebook Login in your app and access additional elements of a person's Facebook profile, you will need to submit your app for review. If your app is not approved or you don't submit for review, people will not be able to use Facebook Login in your app.
https://developers.facebook.com/docs/facebook-login/review
According to Facebook Graph API for Friends you need user_friends permissions which states that:
Only friends who installed this app are returned in API v2.0 and higher. total_count in summary represents the total number of friends, including those who haven't installed the app.
Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app.
Read change log
You can debug me/friends endpoint as well.

Group add request using facebook graph api?

Are there any built-in "Group add request" actions that come with the facebook graph API? Like the built-in Like action? That happens with a users request. I would like to do this from an external website, just like the Like action works
For example the user is active in a forum, where different categories have their own facebook group page, and they would like to access the group without having to actually log on facebook and make the request.
From the docs:
Invite User
Applications can invite users to a group by issuing a POST request to /GROUP_ID/members/USER_ID with an app access_token.
Note that user being invited must be a user of the application. The user will be sent a notification saying that they have been invited to the group. The notification will take them to the group page. Users can only be invited once. Subsequent invites will fail.
So you the user will have to authorize your app, and then you can do it.

Private beta and invite only application launch using facebook authentication

We have a scenario where application is scheduled for a private beta launch. Also, application will only have login via facebook facility.
As per the app workflow, we will initially send invite to a few selected users who will then authenticate using facebook. Authenticated users can establish connections with their facebook contacts within application context. As they establish these connections, application will send out invites visible only to connected contacts of the user. Invited contacts can then login into the application using facebook auth.
What I have tried and where the problem is:
Notifications: As per facebook docs, only canvas applications can send light weight notifications. Even if we decide to launch application within facebook canvas, notifications can be sent to user contacts (those contacts who have not already authorised application) only via User-generated requests (i.e. via Request dialogs). This doesn't go well with application requirements and needs i.e. showing a request dialog every time user establish a connection with it's contact doesn't seems like a nice user experience to us.
Wall Posts: Another possibility is to post invitation on contact wall. However, facebook doesn't seems to provide an ability to control privacy of posted feeds on contacts wall. Documentation says Post privacy settings (can only be specified if the Timeline being posted on belongs to the User creating the Post)
Is there a legal way to launch application under private beta / invite only using facebook authentication mechanism ? Since application is targeted for a specific kind of user group, we would like to control who gets to try the application.

Sending emails to friends from facebook application

I want to invite friends via facebook to my application. For example user can send his friends facebook IDs to my php service, and this service send them emails via facebook api. I found notifications.sendEmail function for that, but it send email only for me if I logged in FB. So, can I send invitation emails by FB api if they are not users of my application?
For sending app requests, please use https://developers.facebook.com/docs/reference/dialogs/requests/ as it is against policy for an app to automatically send app request to friends of its users. It must be user initiated and also user driven as to which friends get invited.
Also, you cannot get email addresses of a user's friends, this is also prohibited.

Sending Facebook messages through their API - possible?

I'm building a web app for a client where members of general public can create an account. Client would like to be able to use my app to send Facebook messages to those members.
Note that my app is a standard LAMP site and NOT a facebook application, nor is there the desire to create one; delivering messages to members' FB inbox is the only goal.
Is this possible, using the FB API or any other way?
In short the answer is no. Facebook do not give you the ability to do this to prevent spam. You could post to all of your user's feeds however?
What you would need to do is:
Register facebook app to get access to FB API. You don't need to have actual facebook app, just use received API key on your standalone site.
Create authentication process on your site so users would be able to connect with your site through facebook.
Ask users for additional extended permissions during authentication to access their email, as it is not something that could be accessed without user's explicit permission.
That's the bare minimum for this task.

Categories