Facebook "out of office" app - facebook

I’d like to implement an “out of office” app for Facebook messages but it doesn’t seem technically possible. The idea is simple, let the user define some dates they won’t be reading Facebook messages (i.e.: they're off-line camping) so that when they get a new message we can notify the friend/sender they won’t be able to respond quickly.
I’ve been reading Facebook’s API and, although I can read user’s messages with proper authorization (read_mailbox), I cannot send messages on their behalf.
A workaround would be to get the email address of the sender, and answer with a plan email instead of a Facebook message. But getting the sender's email also requires extended permissions on a per user basis.
I could present the Send Dialog, but logically we want this to work automatically without any user interaction. Also, we could post a private status only visible to the sender, but that doesn’t seem very effective.
This is where I hit the wall. Can you think of a way to implement such functionality?

You can email to username#facebook.com (getting the username from the user id does not require any permissions) – but Facebook’s policies forbid apps from using that in general, because they say these addresses are intended for user-to-user communication.
You could make a point saying, that this was essentially user-to-user communication – but use at own risk. You’re app may be blocked if there’s spam complaints or if Facebook sees you sending a massive amount of messages this way.

Related

User data in event for Facebook server to server

I plan to generate Facebook events (Conversion API) on server side when the user completes registration process. These events will be used for advertising my solution in Facebook and tuning target audience on registration events.
I use POST request to https://graph.facebook.com/v9.0/289777498957502/events to send events. I have to pass user_data entity inside a body of this request. This user data can be email address, click id, user IP address or something else.
I don't have any of these on server side but I can get it.
The problem is that I don't understand why Facebook needs user data and what exactly it needs as data. I can send everything to Facebook but I need to understand mandatory information it requires.
Do you know what should be sent as user data?
As an option I can send internal ID in my system of each user inside user data but I'm not sure Facebook will be happy with that.
Facebook manuals are a pure joke. Literally all are outdated and no information on user data content and why it's required.
The problem is that I don't understand why Facebook needs user data
Because your conversion is (ideally) supposed to get connected to an actual user account. Facebook knows, who the user is, as long as we are on the client side, and their pixel is embedded somewhere - they can make the cross-domain requests in the background, to see who is currently logged-in to Facebook on the device. But if you send conversion data later, from your server - how would they be supposed to associate that with a specific user then, if you don’t send them any data that could identify one?
and what exactly it needs as data.
If you have anything that can uniquely identify the Facebook user, then send that.
Otherwise, send as much data as you can – to increase the posibility, that Facebook will be able to match this to a specific individual.
Check the list they provide under https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters
If the user is logged in to your Facebook app while they are on your site, then send the fb_login_id – that is as unique and specific, as can be.
If you don’t use Facebook login on your site, or the user can also perform the action in question without being logged into your Facebook app - then send whatever you have, that identifies them on your end.
In case no unique match is possible, then send as much as possible - first & last name, phone number, date of birth - all those help to narrow down who the user might be on Facebook’s side.
The same data, or at least as much of it as is available at this time, should also be send with the pixel tracking code on the client side already. https://developers.facebook.com/docs/facebook-pixel/advanced/advanced-matching/ has details on that.

Is there an ability to delegate contacts with the new contacts.google.com via API?

Just want to know if there is a way to do this yet. I went through their https://developers.google.com/contacts/v3/ site to look for more info but I can't find anything on delegation.
To elaborate.
Due to legal issues, when we get requests for users to get "delegated access" to email. We use API calls to make the changes in order to not log into their accounts directly and make the changes. We have an API Call for email forwarding and email delegation, but we do not have one for contact delegation. Searching their site, i'm not finding how I would do that call.

Instagram Real-Time

I have a doubt about real-time Instagram subscription in the API. Can i subscribe to whatever user i want? or there is some restrictions about the users that i want to subscribe?
I arises this doubt because in the Instagram of real time subscriptions page says: Note that this subscription is for all of the client's authenticated users, not just a specific user.
Its means that i can only subscribe the users that have authorithed my app in Instagram??
I have to make an app that consumes the instagram subscriptions and when there is a new photo it automatly saves it in the DB.
Thanks
A few things, first if you use the "user" type, then you are correct it will ping your endpoint any time any user who has authorized your app posts, there is no IG side filter (yet), but you can easily filter on your end once you get the notification. Oddly, I did notice it now sends the media_id of the post (although the docs say it doesn't!?). If users do not authorize your app, then the only way to get notifications is via the other endpoints such as by tag.
I have found some issues though when dealing with "private" users, and some strange filter behavior to watch out for.
A final point, you said you want to save to your db - that could be in violation of their use policy, so be sure to clearly understand what IG's rules are and that you don't break them.
Hope this helps,
P

Is it possible to determine the #Facebook.com email address of a user?

Is it possible to figure out reliably what the Facebook email of any Facebook user would be? I know earlier this was not possible because not all users had a username. But I believe that has changed since...
I'm trying to figure out a way to let a user send a direct message to their friend through my app. The Request feature is pretty messed up now as you cannot send a custom message, which means most friends are probably going to ignore the request.
The type of messages that I am trying to let my users send to their friends would not be considered spam by Facebook, as these are messages sent directly from the user to their friend, except it is done through the app. But it's pointless if the message just says "Joe wants you to try this app..." The usefulness of an app on the Facebook platform is becoming questionable now.
I think that facebook terms and conditions disallow this...
Facebook messaging (i.e., email sent to an #facebook.com address) is designed for communication between users, and not a channel for applications to communicate directly with users."
Despite your caveat at the end of your post I believe that facebook would consider this a message from your app to the user.
In terms of your question, then the user data returned includes 'username' which is the information you need to create the email address.
Is it possible to figure out reliably what the Facebook email of any Facebook user would be? I know earlier this was not possible because not all users had a username. But I believe that has changed since...
Yes, now every user should have a username set – if not by themselves, than FB will have chosen one for them.
Besides that, I think writing to userid#facebook also works.
But I agree with combinatorial’s answer – Facebook explicitly says that this should not be used for app-to-user communication. To judge if your case is OK is up to you – otherwise you might consider using the send dialog instead, that’s more of the “designated” way to have users communicate “through” your app.
If what you are looking for is to give them a new message notification, it is not going to work. Because, if you send an email to the facebook email, it will land in the Others folder in the message box, which is like a spam box.Try mailing your own #facebook id and see what happens.
And Facebook doesnt give any documentation of how to get users #facebook email, most probably because they dont want developers to use it.
Why dont you mail them directly? You can easily get their email by adding email to the scope, and you can catch the email easily too.
$data = file_get_contents("https://graph.facebook.com/me?access_token=xxxxxx");
$data = json_decode($data,true);
$email = $data['email'];
Is that a viable option in your case?

Facebook Connect Implementation questions

I hope this is allowed but I have a number of questions regarding Facebook Connect, I'm quite unsure on how I should approach implementing it.
I am working on a live music type service and currently have user registration, etc. If I were to implement Facebook Connect alongside this, would I still be able to email the Facebook Connect users as if they were on my database?
Also, would it instead be possible to let users who have Facebook "link" their accounts once registered so I am able to give them the benefits of sharing via Facebook and inviting friends while still having an actual registered user on my system.
I have tried to read up answers to the above questions but what I've found is quite ambiguous.
Thanks, look forward to your views.
Facebook's documentation process is very poor, so don't feel bad about having a hard time getting started. Their wiki-style approach to documentation without any real official documents tends to leave the "process flow" tough to grasp, and requires piecing together parts of a bunch of randomly scattered docs.
Facebook has an obligation to protect privacy, so they never make a user's actual email address available to application developers, through Connect or normal applications. They do have a proxied email system in place that you can use, however, you must get explicit permission from a user in order to email them. There's a decent document on proxied email here. You can get permission by prompting for it; there's several methods for doing so linked in that document.
In regards to linking Facebook and local accounts, this would definitely be the way to go. Once a Connect user logs in, you want to store that fact for that user so you can provide the Facebook-specific functionality. I would simply create a normal user account in the database for every new Connect user that came by, with it's own local id, so that you don't have to do special handling of two different types of user accounts all over the site. That being said, the account would obviously have to be marked as a Facebook user's account (I use an externalId column in my users table), and any part of the site that relied on information you might otherwise have locally would have to handle the Facebook aspect properly (such as using proxied email instead of normal email).
For existing users, you could arrange an "account link" by having a process whereby they log into FB Connect after they've logged into the site already, and you could detect that and simply add their FB id to your users table. After that, they could log in through Connect in the future, or through your normal process. I've never done this, but it should be possible.
If you write the account handling code generically enough, your site will be able to function well no matter what kind of user you throw at it.