gpt4 book ai didi

ios - 无法从 OAuth iOS 中提取用户 Facebook 电子邮件地址

转载 作者:行者123 更新时间:2023-11-28 17:34:37 24 4
gpt4 key购买 nike

你能帮忙解决一些卡在这里的问题吗,让我们先看看代码,在这里我请求权限

 NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithCapacity:0];
[params setObject:facebook._appId forKey:@"client_id"];
[params setObject:@"token" forKey:@"response_type"];
[params setObject:[NSString stringWithCString:"email,user_about_me,read_stream,publish_stream,offline_access" encoding:NSUTF8StringEncoding] forKey:@"scope"];
[facebook dialog:@"oauth" andParams:params andDelegate:self];
[params release];

这里使用@"me"作为图形API

- (void)fbDidLogin 
{
[facebook requestWithGraphPath:@"me" andDelegate:self];

}

但我得到的只是

- (void)request:(FBRequest *)request didLoad:(id)result
{
[UIApplication sharedApplication].networkActivityIndicatorVisible=NO;
NSLog(@"FB result %@", result);
}

Facebook 结果 ( "Justfortest Workingin", 100002369945695)

但是如何获取邮箱地址呢?

最佳答案

facebook = [[Facebook alloc] initWithAppId:kYourAppID andDelegate:self];    
NSArray *permissions = [[NSArray alloc] initWithObjects:@"publish_stream",@"publish_actions", @"email",@"user_about_me",@"offline_access",nil];
[facebook authorize:permissions];
[permissions release];

那么你应该得到你需要的一切

对于对话框而不是网络浏览器,这就是您所需要的:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:10];
[params setObject:kFBAppId forKey:@"client_id"];
[params setObject:@"publish_stream,email,offline_access" forKey:@"scope"];
// Now popup the login dialog
[facebook dialog:@"oauth" andParams:params andDelegate:self];

关于ios - 无法从 OAuth iOS 中提取用户 Facebook 电子邮件地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10208113/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com