iOS应用中的Firebase数据库提取警告

时间:2017-07-11 16:44:07

标签: ios firebase firebase-realtime-database

当我尝试从Firebase数据库中提取时,我收到以下日志。

2017-07-11 18:32:19.636 Editor[3529] <Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled
2017-07-11 18:33:13.859 Editor[3529] <Notice> [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag 
FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2017-07-11 18:33:13.866 Editor[3529] <Error> [Firebase/Core][I-NET901017] <Firebase/Network/ERROR> Encounter network error. Code, error: -1200, Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x170127c60>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9806, NSErrorPeerCertificateChainKey=(
    "<cert(0x102829200) s: *.googleapis.com i: Google Internet Authority G2>",
    "<cert(0x10282c800) s: Google Internet Authority G2 i: GeoTrust Global CA>",
    "<cert(0x10304c800) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"
), NSUnderlyingError=0x17005fa40 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x170127c60>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9806, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9806, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x102829200) s: *.googleapis.com i: Google Internet Authority G2>",
    "<cert(0x10282c800) s: Google Internet Authority G2 i: GeoTrust Global CA>",
    "<cert(0x10304c800) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"
)}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://play.googleapis.com/log, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorClientCertificateStateKey=0}
2017-07-11 18:33:13.871 Editor[3529] <Error> [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x170127c60>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9806, NSErrorPeerCertificateChainKey=(
    "<cert(0x102829200) s: *.googleapis.com i: Google Internet Authority G2>",
    "<cert(0x10282c800) s: Google Internet Authority G2 i: GeoTrust Global CA>",
    "<cert(0x10304c800) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"
), NSUnderlyingError=0x17005fa40 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x170127c60>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9806, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9806, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x102829200) s: *.googleapis.com i: Google Internet Authority G2>",
    "<cert(0x10282c800) s: Google Internet Authority G2 i: GeoTrust Global CA>",
    "<cert(0x10304c800) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"
)}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://play.googleapis.com/log, NSErrorFailingURLStringKey=https://play.googleapis.com/log, NSErrorClientCertificateStateKey=0}, with Status Code: 0

但是,代码可以正常工作并获取正确的数据。为什么要警告?

代码:

func fetchSignedInFirebaseUser(onFailure: @escaping ErrorAction, onSuccess: @escaping Action) {
    guard let userId = Auth.auth().currentUser?.uid else { return }
    database.child("users").child(userId).observeSingleEvent(of: .value, with: { (snapshot) in

        guard snapshot.exists() else{
            print("User doesn't exist")
            return
        }

        // Get user value
        if let value = snapshot.value as? NSDictionary, let username = value["username"] as? String {
            let user = FirebaseUser(username: username)
        } else {
            onFailure(nil)
        }
    }
}

0 个答案:

没有答案