0

I am trying to implement a small feature using facebook feed to get the timestamp of user's last activity but I am facing insane issues doing so. For me documentation isn't enough, I've spent the complete day and I am nowhere.

I am using Java for the backend, and I need a feature for iOS app's backend.

Feature: I have user's fbId and app secret. user login itself using app and app is saving fbId in the backend.

In Backend, I need to see when the user last used Facebook (using feed) and determine if I should reset a timer or not.

Requirement:

1) I need some way to get a lifetime access token or some way to get an access token with userFbId and app secret that iOS app is saving to DB after getting permission from the user.

2) I need to know how I can fetch feed for the user. (For this I found an example)

I found some examples using restFb, but they aren't enough for the auth process. Its server so I can't prompt user to get me anything, and since its kind of a cronjob, I cant ask app to get me access token when it expires, because user may or may not using it.

Usman Tahir
  • 2,513
  • 4
  • 24
  • 38
  • Repost of https://stackoverflow.com/questions/20125895/getting-posts-from-a-page-using-facebook4j-api – Akash Aug 06 '17 at 18:06
  • Not exactly, I am actually looking for my requirement 1, which isn't answered in that as well. – Usman Tahir Aug 06 '17 at 22:29
  • Facebook will most likely not grant your app the use of the permission necessary to read the user’s feed for such a purpose. – CBroe Aug 07 '17 at 07:51
  • for req 1 you can use a long living access token. Check the Facebok docs how this is done: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension#long-via-code I think req 2 is solved with 1 somehow, but you should be prepared for the use case that a access token is invalid. BTW if a user is not even using your app anymore, why do you need the date of the last interaction with Facebook. And the Feed is not enough in a general view ;) – Norbert Aug 07 '17 at 08:03
  • I just need feed for users using my app, not for people not using it. and my problem is with creating token. Let me update my question for this and elaborate Req 1 more – Usman Tahir Aug 08 '17 at 11:24

0 Answers0