美文网首页
facebook登录随机报错 Error Domain=com.

facebook登录随机报错 Error Domain=com.

作者: 扛支枪 | 来源:发表于2019-04-10 13:11 被阅读0次

    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
    

    这两个方法出处,如果有更新,请以链接处的为准。
    解决方法出处.

    相关文章

      网友评论

          本文标题:facebook登录随机报错 Error Domain=com.

          本文链接:https://www.haomeiwen.com/subject/dgjniqtx.html