facebook报错:
Error Domain=com.facebook.sdk.login Code=308 "(null)"
我当前解决方法是:找到这个文件FBSDKUtility.m 大概第 63 行开始,用以下代码替换这两个方法即可
+ (NSString *)URLDecode:(NSString *)value
{
value = [value stringByReplacingOccurrencesOfString:@"+" withString:@" "];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
value = [value stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
#pragma clang diagnostic pop
return value;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ (NSString *)URLEncode:(NSString *)value
{
return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef)value,
NULL, // characters to leave unescaped
CFSTR(":!*();@/&?+$,='"),
kCFStringEncodingUTF8);
}
#pragma clang diagnostic pop
网友评论