2

思ったほど際どいわけではありません-私は以下のコードを使用して、ユーザーの男性または女性の友達だけを取得していますが、正常に機能します。ただし、ユーザーの友人が会議に興味を持っている性別、つまり男性、女性、またはその両方のリストである「meeting_sex」も確認したいと思います。(ここで説明します)

Meeting_sexには、グラフAPIエクスプローラーに追加したfriends_relationship_details権限が必要ですが、出力は次のようになります。

"data": [
{
  "name": "ABCDEF", 
  "pic_square": "https://abcdefg.jpg", 
  "sex": "male", 
  "meeting_sex": null, 
  "uid": 123456789
}, 

つまり、meeting_sexはnullに戻ります。私はmeeting_sexが他の要素のように単なる文字列ではなく配列であることを知っていますが、なぜそれがnullに戻るのですか?

私はFQL、そして実際にはすべてのQLに慣れていないので、配列を正しく読み取ったら、どのように比較しますか?つまり、WOMENが好きなMENまたはMENなどが好きなMENのみを返します。現在のコードは次のとおりです。

NSString *queryString =  [NSString stringWithFormat:@"SELECT name, pic_square, sex, meeting_sex, uid FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND sex = 'male' ORDER BY name"];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys: queryString, @"query", nil];

[FBRequest getRequestWithParams:dictionary
                     httpMethod:@"GET" 
                       delegate:self
                     requestURL:@"fql.query"];

助けてくれてありがとう:)

マイケル

4

3 に答える 3

1

私は自分のアカウントでこれを試しましたが、友達の1人を除いてすべてnullが発生します。それらには、meeting_forとmeeting_sexの両方に空の配列があります

私は、これがもはや使用されていないことを示唆している人がいることを発見しました:

http://forum.developers.facebook.net/viewtopic.php?id=103173

また、これにはプライバシーに関する懸念がたくさんあるようです。

https://www.facebook.com/settings/?tab=privacyを参照してください。 [アプリとウェブサイト]、[ユーザーが使用するアプリにあなたの情報をどのように提供するか]をクリックします。

また、https://developers.facebook.com/docs/reference/rest/users.getInfo/から

User Privacy and Visible Data

Important: Depending upon the user's privacy settings (including whether the user has decided to opt out of Platform completely), you may not see certain user data. For any user submitted to this method, the following user fields are visible to an application only if that user has authorized that application and specifically chose to reveal them:

    meeting_for
    meeting_sex
    religion

編集

Graph APIのユーザー(https://developers.facebook.com/docs/reference/api/user/)オブジェクトの新機能:

Interested_inユーザーが関心を持っている性別user_relationship_detailsまたはfriends_relationship_detailsarray文字列を含みます。

于 2011-12-29T17:53:44.303 に答える
0

ドキュメントによると、requiresuser_relashionship_details または friends_relationship_detailsuser_relashionship_details友達だけでなく、ユーザー自身に関するこの詳細を取得するには、追加する必要があると思います。

于 2011-12-22T16:49:46.767 に答える
0

私の場合、json属性から "meeting_sex"に必要なデータを取得できました: "gender": "male"、 "interested_in":["female"]

お役に立てれば。

于 2013-11-23T16:03:07.150 に答える