특정 사용자로부터 메시지를받을 수 있습니까?특정 사용자로부터 메시지를 가져 오는 방법이 있습니까
내가받는 사람이 자신을 어디에 모든 메시지를 얻을하려는 경우와 X
나는 그래서 가능하며, 쿼리의 종류를 만들 수있는 방법을 찾지 못했습니다?
특정 사용자로부터 메시지를받을 수 있습니까?특정 사용자로부터 메시지를 가져 오는 방법이 있습니까
내가받는 사람이 자신을 어디에 모든 메시지를 얻을하려는 경우와 X
나는 그래서 가능하며, 쿼리의 종류를 만들 수있는 방법을 찾지 못했습니다?
var fbid = your_fbuid_here;
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time ASC LIMIT 1'
}, function (threadresponse) {
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id = ' + threadresponse[0].thread_id + ' ORDER BY created_time ASC'
}, function (inboxresponse) {
//do stuff here with results
});
});
또는이
var fbid =the _freind_fb_uid_here;
FB.api({
method: 'fql.query',
query: 'SELECT thread_id, body, author_id, created_time FROM message WHERE thread_id IN (SELECT thread_id FROM thread WHERE folder_id = 0) AND author_id = ' + fbid + ' ORDER BY created_time DESC'
}, function (threadresponse) {
//do stuff here with results
});
facebookfacebook-fqlfacebook-apifacebook-graph-apifacebook-fql-query
흠, 이건 내 첫 번째 스레드를 반환합니다, 그건 내가 찾고있는 것이 아닙니다. –
your_fbuid는 메시지와 일치시키려는 사람 중 하나입니다. 첫 번째 쿼리는 스레드 fql에서 thread_id를 가져 오는 것이고 두 번째 fql은 모든 메시지를 가져 오는 것입니다. –
잘 메시징 스레드의 작성자가 될 수도 있으므로 작동하지 않습니다. –
이제 FQL가없는 필드 author_id
만 originator
및 snippet_author
을 할 수 있습니다. 그러나이 필드에는 잘못된 데이터가 들어 있습니다. 예를 들어, userA는 나에게 userB 메시지를 보냅니다 : userA는 스레드를 만듭니다. 어쨌든 나는 그 창안자가 나 (userB)를 가지고 볼 수 있습니다.
가장 좋은 방법은 사용 recipients
:
SELECT recipients,snippet,object_id,updated_time,unread,unseen,thread_id FROM thread WHERE folder_id=0 AND recipients IN (userA_fid, userB_fid)
그러나 그것은 또한 일을하고 빈 데이터를 반환하지 않는 것 ...
그래서 어떻게 든 스레드를 얻을 수 있습니다? –