2014-09-05 72 views
0

我正在使用Facebook SDK。我的簡單問題是。 Facebook SDK是否允許我們在某些特定組中發佈Feed?如果是,請爲請求提供graphPath。我一直在努力獲取Facebook羣組列表。在Facebook羣組中發佈Feed

- (void) getGroupList 
{ 

     FBRequest* req = [FBRequest requestForGraphPath:@"/me/?fields=name,groups"]; 
     FBRequestConnection* reqconn = [[FBRequestConnection alloc] init]; 

     [reqconn addRequest:req completionHandler:^(FBRequestConnection *connection, 
              id result, 
              NSError *error){ 
     FBGraphObject *graphObject = result; 
     id<FBGraphUser> graphUser = (id <FBGraphUser>)graphObject; 

     NSArray *groupsArray = [[graphUser objectForKey:@"groups"] objectForKey:@"data"]; 

     for (id groups in groupsArray) 
     { 
      NSString *groupName = [groups objectForKey:@"name"]; 
      NSLog(@"Group Name:%@ ", groupName); 

     } 
     }]; 

     [reqconn start]; 
} 

回答

0

試試這個:


[FBRequestConnection startWithGraphPath:@"/{group-id}/feed" 
          parameters:nil 
          HTTPMethod:@"GET" 
         completionHandler:^(
          FBRequestConnection *connection, 
          id result, 
          NSError *error 
        ) { 
          /* handle the result */ 
         }]; 
+0

感謝那些爲我工作 – AltafBangash 2014-09-10 11:29:17

相關問題