Facebook SDK Android: newly app installed users who are my friends on FB do not show up in app unless re-login

  • Replies:0
  • Answered
  • Forum posts: 1

Feb 4, 2017, 2:13:19 PM via Website

Hi friends,
Could you please advise on this?

We are coding an Android app that has their users login via Facebook (SDK v[4,5)). Our app requests only the user_friends permission, after which, it is supposed to display a listing of their current FB friends, that have our application also installed.

For obvious UX purposes, the login screen is displayed only upon fresh install; any subsequent app launches check for the login state and skip that screen if logged in. This is done using the following snippet:

// skip
// show login button, request the user_friends permission
My friend (#1) and I have installed the app, since we had been friends and FB already, we saw each other in the listing as expected. So far, so good.

The problem started to occur when we added a new friend (#2) on FB afterwards and had him install the app. - Out of the box, me and #1 cannot see #2 in our listings, #2 cannot see us - In the Graph API Explorer (logged in as me, new token generated), I can see #2, but NOT #1.

So we check (Log.i()) the user-access token that our app uses and it turns out, it stays the same for days. If I uses that specific token in the Graph API Explorer, I see only #1 listed, just like the app would show.

Logging out and logging back in (reinstalling app or using a newly-added logout button) fixes the listing (with a token generated AFTER #2 granted user_friends to the app), but this has to be done on existing apps every time a new user is friended on FB and installs the app, which is bad for UX.

Also, meanwhile I changed my name on FB (only order) and our app does not refresh it either, I can see my name in app the same as when I have installed the app to my phone for the first time. Reinstalling the app and re-logging in app does not solve this, it only helps to display new friends that have newly installed the app.

Moreover I want to be able to refresh the friends listing in onResume, not just when the app is launched, but the token seems stuck in the past.

Any help on this???

MAYBE - Is there a way to force-reset the user-access token without bothering the user with a login/grant-permission prompt?

Guys, any help much appreciated, as we cannot move on a step, it is so crucial. Thank you :)