Replacement for old GetAppUsers call to see a user's friends who use my application?

后端 未结 2 1906
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 05:25

One immensely useful call in the old REST API is Friends.getAppUsers. This call returns all your friends that are using an application. Sadly, this is not in th

2条回答
  •  伪装坚强ぢ
    2020-12-24 05:35

    The replacement API call for users.isAppUser is a simple call to /me/?fields=installed This also works for a user's friends so by extension it's a replacement for friends.getAppUsers.

    I tried this both with the App Access Token and a regular User Access token. Make an API call to /{user id}/friends?fields=installed - The return looks like this:

    {
      "data": [
        {
          "id": "{FRIEND_UID_1}"
        }, 
        {
          "id": "{FRIEND_UID_2}"
        }, 
        // etc...
        {
          "installed": true, 
          "id": "{FRIEND_UID_X}"
         }
    

    //SNIP

    You can use the presence, or lack therof, of the installed:true to determine which of the user's friends use your app.

    If that doesn't work for you for some reason; won't you already have a list of uids of users of your app in your own database? You could just retrieve the user's full list of friends and compare it to your own records of who's using your app.

提交回复
热议问题