2012-11-28 25 views
1

一個用戶時間軸上的用戶從Facebook飼料:獲取從我目前使用這段代碼來獲取Facebook的API

FBRequest *friendsRequest = [FBRequest requestWithGraphPath:[NSString stringWithFormat:@"%@?fields=cover,first_name,last_name,relationship_status,feed", self.friendID] parameters:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"en_EN", @"locale", nil] HTTPMethod:nil]; 
    [friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection, 
                NSDictionary* result, 
                NSError *error) { 

     postsArray = [[NSMutableArray alloc] initWithArray:[result valueForKeyPath:@"feed.data"]]; 
     [tableView reloadData]; 
     NSLog(@"Data found: %@", [result description]); 
     NSLog(@"Posts: %i", postsArray.count); 
      }]; 

然而,這個「喂」也包括他自己的東西,如「XXX發佈'或'用戶A喜歡發佈B',我想要獲取用戶發佈的內容以及其他人發佈到他的牆上的內容(例如,如果您訪問facebook.com或iOS應用程序中的用戶時間表) 。那可能嗎?如果不是,我怎麼能發現一個狀態是'喜歡'還是'評論...'?

回答

0

爲什麼不使用read_stream許可和FQL

文檔here

可以遍歷結果並找到type等於:

46 - Status update 
56 - Post on wall from another user 
+0

謝謝,懂了工作。但'type'總是返回null ...'FBRequest * fql = [FBRequest requestForGraphPath:@「fql」]; [fql.parameters setObject:[NSString stringWithFormat:@「SELECT post_id,viewer_id,app_id,source_id,updated_time,created_time,filter_key,attribution,actor_id,target_id,message,app_data,action_links,attachment,impressions,comments,likes,place,隱私,永久鏈接,xid,tagged_ids,message_tags,description,description_tags,類型FROM流WHERE source_id =%@ LIMIT 50「,self.friendID] forKey:@」q「]; –

相關問題