Integrating facebook 'compose new message' popup into my website - facebook

I am designing a website that will be heavily integrated with facebook. Members connect to the site via their facebook accounts and facebook authentication/permission is used to access their friends list and other information.
There are instances in which I would like the site to be able to send facebook inbox messages to selected people from the user's friends list (in a user initiated manner).
I have discovered that this is not possible through facebook permissions.
One idea that I have is to have Facebook's "Compose New Message" popup to appear overlayed on top of my site (as would appear when clicking the "Send new message" button on a user's profile page). The user would then type a message and press send (hopefully circumventing the permissions issue).
I have browsed the facebook developer docs and forums, but my technical knowledge is limited. I just want to know if this is possible or not, and to be pointed in the direction of material on how this could be achieved (so that I can pass this on to hired developers once I reach that stage)
Any help or suggestions on alternatives would be gratefully received!
Pete

The closest you can be to your goal is using the Send Button. However, this button is used to share links, which are usually open graph pages. What you can to is specify a dummy href/link so that it shows a blank page. Or, better if you actually needed a link attached, then you have no problem.
There is no way of doing it using Graph API Message Object. There are no publishing rights to this object whatever permission you ask from the user. It is read-only. Just look at the extended permission it is only read_mailbox - "READ_mailbox".
Even FQL can't help us with this.
Also, facebook is in the process of migrating to a new messaging system. So playing around with is now is not advisable.
What you can do now is utilize the Send button I mentioned above.

Related

How to automatically post to Facebook

Please could you help. I have created a website that allows people to upload listings of items they are selling. I want to know how to add the feature where when someone creates a listing, it automatically posts on the user's FB page, with a link to the listing on our website. Is this possible? Would the user have to log into our website using their FB account for this to happen? Thanks everyone for your help.
Martin
You need to create a Facebook App and use Facebook Graph API with publish_actions permissions to do that. Note that the facebook rules prohibit sending fully automated messages that the user has no control, your user must have the ability to edit the message before sending

If Facebook Feed dialog is deprecated, how are you to share posts on Facebook?

I have been working on a Facebook app for some time, and we are having trouble getting the app approved. I feel like Facebook's app approval process is a constantly moving target and their explanations are provide the least amount of detail possible, leaving the door open for further rejections.
We are using a Facebook app to provide sharing functionality for products that are behind a paywall. All of our share buttons are custom, so they fit in our designs (we don't want to use the out of the box buttons). We first built the app attempting to use the recommended share dialog with open graph actions and stories. The problem here is that you can only use the share dialog with a shared link. Facebook reads any open graph tags on the page to provide sharing information, but because there are many different "products" on a given page, we can't use open graph tags. Because of our environment, we couldn't use the actions or stories. Furthermore, we'd like to customize that share information, so using share dialog is not an option.
Unfortunately, we had left our open graph stories and actions in our app when we first attempted approval. In our first denial, Facebook told us that we had implemented our open graph actions and stories incorrectly. We were not using the share dialog, but the 'feed' method, which is deprecated in 2.0 but still works. Thinking that Facebook looked at our app and noticed we were not using those actions correctly, we figured if we removed those stories and actions from the app, Facebook would see our share method worked and approve us. Wrong.
We had built the share using the publish_actions permission, along with FB.login() and FB.ui(). Facebook denied us because our app did not need publish_actions. They recommended we use the share dialog which did not need login or permissions.
We removed the publish_actions permission and FB.login(). When we tested this, you could still login to Facebook and perform the share WITHOUT fb.login(). So we thought it was good to go. It was not; Facebook told us we needed to implement login(), even thought the docs say you don't need it.
Now we have reimplemented login() and are going to try to get it approved again, but I have a feeling it's going to get rejected due to the 'feed' method being deprecated.
So my questions are:
A) If you have a website providing a paid service, how do you allow your users to post to their feeds, using the newer share method, with data you'd like? Eg: "I just completed the Get Moving III workout at teamexos.com!" The post would contain no pics or links. If it had to, a link to teamexos.com would be ok.
B) How do paid sites provide open graph actions and stories? Do they have public links to their products? Do those products have their own individual pages, with their own open graph tags?
First of all, the feed dialog is not deprecated, at least not anymore. You do not need to get anything approved for it, and you certainly donĀ“t need login: https://developers.facebook.com/docs/sharing/reference/feed-dialog/
But: Your example looks like an Open Graph story, you should consider taking a look at those: https://developers.facebook.com/docs/sharing/opengraph

Can facebook API do this?

On my site I want members to be able to click a link import your Facebook photo then a Facebook popup opens and asks user to confirm that he/she wants to share their profile picture with my website.
Can this be done? What are the steps? I am looking at the Facebook graph API but I am unsure if this is the right thing, I have huge problems understanding their samples and "help" files.
I was able to easily do this with Gmail and Yahoo, uses can get a browser popup from them in order to confirm sharing contacts with my website, I assumed Facebook works the same to import the profile picture but I am spinning in circles.
Within Facebook Terms for users it states that your name and picture are publicly available so one does not need permission to request it.
https://www.facebook.com/about/privacy/your-info
The naitik call is an example of data that is publicly available without asking for permission.
When you are requesting the current user, that is, you don't know the id or name beforehand, then you use a basic login flow which will then present one of the following dialogs.

Facebook will not allow me to post to a user's wall without a dialog. How can causes.com get away with it?

I have an app that allows users to share the page to specific users by clicking on check boxes next to their name and then doing a bunch of posts. I received an alert in February that said I would not be able to post to friends' walls unless there is a dialog box.
However, I noticed if you sign a petition on Causes.com, they do something very similar where they post the petition to a bunch of friends' walls.
I'm curious how they get away with that. Maybe I'm not familiar enough with the Facebook API.
I'm not sure if this helps, but Facebook does have business partnerships with certain sites/companies that have more privileges to their api keys, facebook app. This could be one of these instances.
One instance of this is, when you go to a major site and the site is able to read your facebook session, and within that site they show your name and picture once the site is rendered. In essence, these sites already know who you are.

post content to facebook to users' wall?

i've built a survey and at the end i want the users to share their result on their facebook wall but i'm finding it hard to find any examples or reference.
something like;
<div>
[ image/graphic ]
"I've just completed survey XXX and got 90%"
<a>post on my wall</a>
</div>
any help appreciated - even if its just terminology i can look up!
Start here. Basically, you're creating a website which you want to integrate into Facebook. To do so, your users will need to "login to Facebook" from your site (unless they're already logged in, such as in another browser tab) and allow your site to perform certain actions on Facebook on their behalf.
The Single Sign-On part is where you will initialize your website as a Facebook application (you'll need to create the application on Facebook first) and provide a login button for your users.
Your login button can be set up to ask the user for specific permissions to act on their behalf with Facebook. I think the one you want is publish-stream but I'm only barely familiar with it, play around with the functionality and see what works best for you. Your users will be presented with a pop-up div stating that your website (or application) is requesting these specific permissions and they have the option to allow or deny. An example can be seen here.
Once you have the user's permission, you make use of the cookie (demonstrated using PHP back on the Single Sign-On link) to gain access to information by use of the Graph API, the JavaScript SDK, Social Plugins, etc.
you should use the facebook api.
Get the "publish_stream" right of a user and use the "api" method of the connection object (with parameters like : '/userid/feed', 'post', array of informations about the post).
I can't find the right code and the official document is not always up-to-date.
OR
Just add a facebook "share" button on your page that uses "meta" markups. You should find examples on about 80% of websites.