[英]Java JSON object - How to get the result from Facebook for a given permission in the respone, or if the value is 1 or 0
下面是對權限的查詢-我正在嘗試查看是否授予了特定的燙發。任何幫助將不勝感激...
JSONObject permissions = new JSONObject(
IOUtil.urlToString(new URL("https://graph.facebook.com/me/permissions?access_token=AAACEdEose0cBALhOmvDd14yIJQUTZAJ4GxFmkaHQmGKfwBwS1I32GAIsJolPZAgqB3prnVXqrvwlInYxcutnOOVFdRY6RBcgWfGT46KrSgMzdjnG6U")));
Here is the sample responce {"data": [
{
"installed": 1,
"user_likes": 1,
"publish_stream": 1,
"user_interests": 1,
"user_hometown": 1,
"user_groups": 1,
"type": "permissions"
}]}
要獲取“已安裝”值:
permissions.getJSONObject("data").getInt("installed");
然后根據需要進行比較。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.