Single Facebook App on multiple domains - facebook

I am developing a product for a business, which has n clients, each one with its own website.
Now, what the product does is injecting our Facebook App into the Client's Website, to allow the Client's customers to login and share things on Facebook, with our app.
Facebook prevents this because the site url is different from the one specified in the dashboard.
So, how can we structure the product to allow this kind of usage?

Related

Create multiple Facebook messenger bots with one app

The Facebook messenger bot API seems to require you create a Facebook app for each bot, for each page. The Facebook app stores the webhook, and connects to the page.
Is there a way to have a single Facebook app for many bots connected to many pages?
If you create a bot to resell to clients as a service, you need to be able to do this. But there does not seem to be any way. You need to create a Facebook app for each client, and go through the Facebook app review process for each page which is very difficult.
How can this be avoided?
Can a single Facebook app have multiple webhooks, or access to multiple pages messages?
You can create one chatbot and can use this bot in multiple Facebook pages. All you need is to store PAGE_ACCESS_TOKEN for each page and response messages to the user with right PAGE_ACCESS_TOKEN. You should get the necessary permissions to get page access tokens by Facebook Login. And then you need to subscribe the page to your chatbot(app): https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps
One important thing is Facebook generates a unique identifier for users for each page. Some user#A will have a different SENDER_ID/RECIPIENT_ID on different pages.

Mapping App-Scoped-Ids for apps pulling page posts

We run a platform that acts as a one-stop warehouse of user's interactions with a brand, both through apps (campaigns etc) and through the pages run by the brand. So far, the linking up of facebook users across apps and page-posts was simple - since facebook passed you global facebook ids.
With v2.0 of Graph API, and the migration to app-scoped-id, a brand can still connect the app-scoped-id from various app-authentications through the /ids_for_business api call. When User's log into the app, they are considered authenticated and hence the mapping between app-scoped-ids works.
For posts pulled from the Facebook pages through the API, the "users" are considered non-authenticated, and hence the mappings through /ids_for_business call skip the app_scoped_id listed to page-post-pulling-apps.
Is there a solution to map such users into their app-scoped-ids issued to other apps under the same business account?
Alternatively, is there any other way to reliably map such users across apps and page posts?
Its not currently possible to map a user's ID across multiple apps where the user has not logged into each of the apps you're trying to map across.
The use case for the Business Mapping API it to identify the same use across the multiple apps your business owns - where the user has logged into those apps. For example, identifying which of your business's games the person plays.
The principle here is that a person's information is not aggregateable across apps unless the person has explicitly logged into those apps.

Is a third party website allowed to post messages on facebook, on behalf of another site?

So here's my use case:
A user sees a cool product on a shopping website (sample-shopping-site.com)
They want to share this product with their friends on facebook
They however want to pass the information to an intermediary site (a-sharing-app.com - that i'm trying to develop), that posts to facebook on my behalf.
My questions:
Is this even allowed by facebook? i.e. can a-sharing-app.com put a widget on sample-shopping-site.com, so that a person visiting sample-shopping-site.com can share on facebook via a-sharing-app.com?
If yes, could you point me to helpful bits on the facebook developers API page?
Just want to clarify: the APIs and most questions/examples on the internet point towards sharing directly from sample-shopping-site.com to facebook, by registering sample-shopping-site.com as an App with facebook.
I however want to register a-sharing-app.com as an App, and then putting a widget of a-sharing-app.com on any page (such as sample-shopping-site.com) allows me to share on facebook by passing information to a-sharing-app.com
As far as I know there is no Facebook guidelines that restrict what you want to achieve, so I may safely say that yes, you can create an app so that a person visiting sample-shopping-site.com can share on facebook via a-sharing-app.com . I can even mention a well know service that is doing the same, Disqus.
How you can implement this feature is a little up to you but may I suggest what Disqus or apps like it are doing is, they use the JavaScript API of Facebook to integrate and are mostly enabled within an iframe that loads content from their domain. The exchange of information between sample-shopping-site.com and a-sharing-app.com is done by the JavaScript loader which loads the necessary iframe then. The other things you would like to check would be Dialogs which you may use for different cases, or you may do it on your own using the FB.api and make API calls to the Graph API for sharing data.

How to find out which of your facebook friends are also using your mobile app?

We are building mobile app that uses Facebook for registration (know how to do this).
We would like to have a screen, where all your friends would be listed with indication, if they also use our app.
How should we save data (client, server) that one facebook user is also our app user?
When you're already using Facebook for authentication, you probably already have a column in the user table in your database that holds Facebook profile ids of each user. If you want to distinguish between them, just add a column modeling if that user is also using your mobile app.
By issuing a request to https://graph.facebook.com/PROFILE_ID/friends as described in the Facebook Graph API Documentation you can get the list of friends for a certain user without requiring any additional permissions.
Now just build the intersection between the friends list of the user and your (mobile app) user base and you got the list of his friends that are using your mobile app. You should of course do this comparision on the server, so you don't have to send the Facebook ids of your complete user base around.

How to publish to Facebook page stream and appear as application instead of user

Background:
I have successfully used the Facebook Graph API to publish activity on a particular web site to a Facebook fan page's stream (wall).
To do this I had to create a Facebook application for the web site and add it to my own Facebook user profile, with necessary authorizations.
Problem:
I don't want all the status updates to be associated with my personal Facebook user profile. I'd like the updates to look like they came from the Facebook application for the web site without identifying my personal profile. BTW, I'm pretty sure Facebook prohibits a person having multiple user profiles.
Question:
Is there a way for a Facebook application to post status updates to a stream and not have it look like it came from a particular user profile (i.e. either the application itself or anonymously)?If not, is there some other way to accomplish my goal of posting status updates to a page without identifying my personal profile?
Set up a profile for your company / website and publish updates through that. This is common practice.
Think about it this way. Who's profile should updates for Coca-Cola, Inc be published through? The CEO? The Marketing Director? Neither. Coca-Cola get's it's own company profile. So should your website.