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
Related
I'm working on a web application in which I show the last time the current user (who authenticates with FB and supplies all relevant permissions) user interacted with another user. Example, my ID is 1526632 and would like to find the date of the last message sent between me and another facebook user (either by username, or id #).
I've been reading through their API and it seems this permission existed in version 2.4 of the Chat API but was since deprecated. Is there a new way for developers to get this information somehow?
My guess is this is not possible via the graph API. Assuming this is true, does facebook have unpublished IMAP access to a user's inbox? Or any other creative ways I can do this?
The Chat API is gone, as you have found out already. There is no replacement, what you want to achieve is not possible in any way. The user inbox is off limits now, i´m afraid.
I am writing an app to offer something to FB users depending on their locations.
Current situation : I know how to check one specific user's location.
I may periodically check all my users locations in a loop and compare them with their last positions.
Question: Is there a better method to get notified if any user of my fb app checks in ?
You can try using Realtime Updates, which is a feature that pings your app when a User updates their account. You can activate real time updates from your App Settings page, and configure it to listen to user checkins.
The facebook documentation shows how you can listen to updates. It's much more efficient to use this method, as you avoid making unnecessary calls to Facebook to check each user's checkins.
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.
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'm new to programming Facebook apps but I think I have the general idea down. I'm creating an app that allows users to sign up and select friends to automatically send a birthday message on their birthdays. I know how to grab users and their birthdays, but how do I go about going through my database everyday, grabbing the birthdays and friends, and posting to their walls? I imagine it would take a cron job of sorts but how do I get around the permissions this way? Also, I want to post from the app, not my user account. Do I need to create a user account just for the app?
Thanks all.
You need the extended permissions offline_access and publish_stream to do what you are proposing.
Also research Facebook Platform Policies regarding prohibited actions such as filling the user message parameter, and how Facebook monitors user feedback to automatically ban applications that receive too many hides, blocks, spam reports, etc. Apps that abuse publish_stream and offline_access get shut down very quickly.
You do not need a user account just for the app.
And yes you need a way to run your program on a schedule if you don't want to have to remember to run it yourself every day. a cron job, a Windows Scheduled Task, or other scheduler will be required.