Reading Mailbox or user nodes through iOS app

177 views Asked by At

Why this code gives error in fetching inbox

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                              initWithGraphPath:@"/me/inbox"
                              parameters:@{@"fields":@"inbox"}
                              HTTPMethod:@"GET"];

Error I get on console :

{
    code = 100;
    message = "You can only access the \"inbox\" connection for the current user.";
}

where as if If I use this code to fetch inbox it fetches me the inbox:

FBSDKGraphRequest *request =[[FBSDKGraphRequest alloc] initWithGraphPath:@"me"
                                                          parameters:@{ @"fields" : @"inbox"}];
1

There are 1 answers

0
Sunil Panda On BEST ANSWER

Figured out can not pass fields in param

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                              initWithGraphPath:@"/me/inbox?limit=50"
                              parameters:nil    
                              HTTPMethod:@"GET"];