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

后端 未结 2 1904
爱一瞬间的悲伤
爱一瞬间的悲伤 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:32

    There is a problem with your path.

    uid1 = me()) AND is_app_user=1
    

    = is not URL encoded correctly. Replace = with %3d.

    uid1 %3d me()) AND is_app_user%3d1
    

    This might look ugly. So a better way would be to use the Query/QueryAsync method:

    fb.QueryAsync("SELECT uid,username, is_app_user FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user=1");
    

    If you are using v5.2.1 or earlier, Query will use the legacy REST API. If you are using a version later than v5.3.1, it will use the Graph API to execute the FQL query.

提交回复
热议问题