0

i need to get inbox and outbox messages in Facebook. but i get error as "operation couldn't be completed (com.facebook.sdk error 5.)

NSString *uid=@"10000350024x";
NSString *path=[NSString stringWithFormat:@"%@/inbox",uid];
[FBRequestConnection startWithGraphPath:path
                             parameters:NULL
                             HTTPMethod:@"GET"
                      completionHandler:^(FBRequestConnection *connection,
                                          id result,
                                          NSError *error) {
                          if (error) {
                              NSLog(@"Error is: %@", [error localizedDescription]);
                          } else {
                              NSLog(@"Result: %@", result);
                          }
                      }];
Aaron
  • 7,055
  • 2
  • 38
  • 53

2 Answers2

0

What is myuserid? This should always be me, shouldn't it?

Addition: I assume you've asked for read_mailbox permissions

cweinberger
  • 3,518
  • 1
  • 16
  • 31
  • i used my hid which is provided by fb. in that it will be the uid number. – unPredictable Mar 20 '14 at 09:13
  • did you try with `@"/me/inbox"` for the graphPath? – cweinberger Mar 20 '14 at 09:16
  • yeah i did it.then also the same error. do i need to get any permissions in fblogin read permissions. – unPredictable Mar 20 '14 at 09:55
  • i getting the same error. already i got all access from access tokens in fb. i am asking about any read permissions like @" FBLoginView *loginView = [[FBLoginView alloc] initWithReadPermissions:@[@"basic_info", @"email", @"user_likes",@"read_mailbox"]];" – unPredictable Mar 20 '14 at 10:05
0

the error is due to facebook sdk. i had deleted it from the project and inserted new sdk. now it works well.