Naturally the documentation doesn't make this distinction, which makes me think it doesn't. So very succinctly - does anyone know whether a user losing a friend triggers a realtime update callback? If so, is it the same if the user removed said friend or if the user was 'unfriended'?
If I've missed something in the documentation about this then I apologise, but I assure you I have looked.
The Facebook Realtime API does seem to be providing notifications about certain user fields and connections for the User object. Connections to which you can subscribe include for User object include: feed, friends, likes, checkins, location, events.
And when you have successfully subscribe for user object subscription, everytime users friends is updated, your callback server will be notified.
Related
I am referring following links to the Facebook documentation for real time subscription.
https://developers.facebook.com/docs/graph-api/webhooks
https://www.facebook.com/marketingdevelopers/videos/883648801749520/
For the page, the graph api v2.6/{page-id}/subscribed_apps is used for subscribing the page to the app.
I am looking for the graph api for subscribing user to the app for the real time changes.
I am looking for the graph api for subscribing user to the app for the real time changes.
There is no such endpoint.
For updates from users, you don’t need to create an individual subscription for every single one, like you need to do with pages.
You just do the general setup, that subscribes your app to updates for certain fields/edges of the user object. You then will get updates automatically for the users of your app, when a change on those happens (provided that the users gave your app the necessary permissions to read that kind of data.)
I have an exsiting event which I'm trying to invite users to using this method:
https://api.facebook.com/method/events.invite
?eid=EID
&uids=UIDS
&access_token=ACCESS_TOKEN
...this sort of works, in that the invited user gets a post to their wall like this:
Test Event — 19 March at 14:08.
User invited you · View · Join
But my problem is, the invited user DOESN'T get a notification.
The code is taken from here:
http://developers.facebook.com/docs/reference/rest/events.invite/
But when I run if from there, which is identical to my above code, the invited user DOES get a notification.
What am I doing wrong / missing?
Thanks
You are using a deprecated method and should switch to using graph api requests.
In this case, you can use the Event object in the graph.
Doing the same thing with the graph api should look something like:
https://graph.facebook.com/EVENT_ID/invited/USER_ID
or
https://graph.facebook.com/EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3
(You should have the create_event permission and an active access token of course)
This is copied from the document, under the invited section. You might also might want to check the attending, maybe and declined sections.
You can use the Graph API Explorer tool to test graph calls.
Edit
I'm sorry for not including this with my original answer:
The invitation made by the graph api (or the deprecated REST) does not result in notifications in the users' side.
You can find a few more threads about this subject here:
Invite user(s) to event with notification - works manually but not with Graph API
Facebook: No Notification when App sends event Invites via Open Graph
invite for an event by graph api doesn't send notification
But the best indication for this being the case can be found in this bug ticket: Bugs - No Notifications on Event invites via Graph API.
Notice the response from facebook:
event invites do not currently render an on-site notification, this is
a deliberate limitation of the API Event invites made this way will
still increment the counter in the 'events' bookmark and add the event
to the user's events list
Hope this clarify things.
I want to know if it is possible to get the Facebook Posts or Twitter Tweets from a user at the time that they are created/posted.
I know I can get the old posts/tweets from a certain user, but I need to get them when they are created. Otherwise I must check all the time to know if the user has posted or tweeted something.
Is there a way to accomplish this?
For twitter, see the streaming api - specifically user streams.
For facebook, there are real-time updates.
For Facebook, you can have your HTML code subscribe to the http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ on the "edge.create" which says a like happened. Then you ajax to your server that the user liked it and you store that information in your database.
For Twitter, you can subscribe to events as well. See https://dev.twitter.com/docs/intents
I know how to use graph api - https://graph.facebook.com/{id}/feed|posts to get user's and page's feed.
I also know that facebook provides an subscription API. But I can not use it to check feeds of users i am interested but not our application users (ex: A super idol I am interested but who is not our application users. I want to check not only posts by him but also messages posted by his fans)
Is there a notification service to notify me (callback) the updating of user's feed, such that I don't need to pull graph api periodically to check the updating?.
Thanks.
"I want to check not only posts by him but also messages posted by his fans" and "but not our application users"
This sounds like a stalker app. http://developers.facebook.com/policy/ Facebook says you are not allowed to do that.
Let's say I have a Facebook application which is monitoring friends birthdays. I want to notify the user that her friend will have a birthday in next two days. The first part is only cron which will check the dates, but is there any way how to notify the user? I didn't found anything for this. It was there a year ago but all of the API changes it looks like the removed all offline messages. I don't want to send an email to the user, it will be much more better to stay with everything on Facebook.
Obtain an offline access permission and then use counters to notify the user
The app-generated notifications are still possible. See this doc:
https://developers.facebook.com/blog/post/464