简体   繁体   English

Facebook图形API中的GetAccounts

[英]Getaccounts in facebook graph api

This is a generic question (though I'm using facebook sdk for android). 这是一个通用的问题(尽管我正在将sdk sdk用于android)。

If the getaccounts api call gives an empty array does it mean 如果getaccounts api调用给出了一个空数组,是否表示

a) User had previously denied MANAGE_PAGE permission ? a)用户以前拒绝过MANAGE_PAGE权限?
b) User hasn't yet made the request in the app (which then asks for for MANAGE_PAGE permission) ? b)用户尚未在应用程序中发出请求(然后请求获得MANAGE_PAGE许可)?
c) There are no pages associated with the user account ? c)没有与用户帐户关联的页面?

How to differentiate between above 3 ? 如何区分以上3个?

Thanks. 谢谢。

Use /<ID>/permissions to differentiate 使用/<ID>/permissions来区分

When user hasnt seen manage_pages yet, you should see permissions without manage_pages in it 当用户尚未看到manage_pages ,您应该看到其中没有manage_pages权限

{
  "data": [
    {
      "permission": "user_birthday", 
      "status": "granted"
    }, 
    {
      "permission": "user_likes", 
      "status": "granted"
    }, 
    {
      "permission": "user_events", 
      "status": "granted"
    }, 
    {
      "permission": "user_friends", 
      "status": "granted"
    }, 
    {
      "permission": "email", 
      "status": "granted"
    }, 
    {
      "permission": "ads_management", 
      "status": "granted"
    }, 
    {
      "permission": "public_profile", 
      "status": "granted"
    }, 
  ]
}

When user declined manage_pages you should see 当用户拒绝manage_pages您应该会看到

 {
      "permission": "manage_pages", 
      "status": "declined"
    }

When all the necessary permissions have been granted and yet the accounts is empty, then there are no pages 授予所有必要的权限后,如果accounts为空,则没有页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM