gpt4 book ai didi

ios - PFFacebookUtil 超时错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:36:18 26 4
gpt4 key购买 nike

我遇到了此处提到的类似问题:https://www.parse.com/questions/error-when-trying-to-reauthorise-facebook-user

当我的应用程序启动时,如果用户已经登录,它会尝试从 Facebook 获取用户的个人资料图片:

- (void)getFacebookIdAndProfileImageWithSuccess:(void(^)(NSDictionary *))success {
// Send request to Facebook to retrieve profile information
FBRequest *request = [FBRequest requestForMe];
[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (error)
return;

// Result is a dictionary of user information
NSMutableDictionary *userData = (NSMutableDictionary *)result;

NSString *facebookId = userData[@"id"];
[userData setObject:facebookId forKey:@"facebookId"];

// Retrieve the user profile image
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/picture?height=55&width=55", BaseApiUrl, facebookId]];
UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:imageUrl]];
[userData setObject:image forKey:@"image"];
[userData setObject:[imageUrl absoluteString] forKey:@"imageUrl"];

success([NSDictionary dictionaryWithDictionary:userData]);
}];
}

好吧,请求返回需要很长时间,当它返回时会报告错误:

"Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x146aa790 {com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x146a1710 {NSErrorFailingURLStringKey=https://graph.facebook.com/, 
NSErrorFailingURLKey=https://graph.facebook.com/, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x1455c110 "The request timed out."}, com.facebook.sdk:HTTPStatusCode=200, com.facebook.sdk:ErrorSessionKey=<PFReceptionist: 0x14685310>}"

最佳答案

我删除了我的应用程序并重新安装了它。这解决了这个问题。问题可能是在我开始收到此错误之前,我正在尝试解决我的应用程序遇到的另一个与 Facebook 相关的问题。我尝试过的其中一件事是删除我的 Facebook 帐户设置 > Facebook。也许这与此错误有关,我不确定。

关于ios - PFFacebookUtil 超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21937954/

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