Can't get email address using facebook sdk for IOS and graph api for facebook

后端 未结 2 2063
借酒劲吻你
借酒劲吻你 2021-02-06 11:15

I am trying to get the email address from a user. He logs in, I ask permission to access email and he chooses ok. Then I use the graph API from facebook to access the email addr

相关标签:
2条回答
  • 2021-02-06 11:30

    I found answer:

     NSArray *permissions = [[NSArray alloc] initWithObjects:@"user_likes",@"offline_access",@"read_stream",@"publish_stream",@"email",nil];
    
      [facebook requestWithGraphPath:@"me"andParams:params andDelegate:self];
      -(void)facebookLoginScreen:(NSDictionary *)result
       {
            NSLog(%@,[result objectForKey:@"email"]);
       }
    
    0 讨论(0)
  • 2021-02-06 11:46

    Ah nevermind, it works. I had to use @"me" in [facebook requestWithGraphPath: @"me" andDelegate: self]; instead of the URL.

    0 讨论(0)
提交回复
热议问题