Ad

Firebase Prints Analytics SSL Error, However Analytics Is Not Being Used

- 1 answer

I have an iOS 12 Swift app that uses Firebase. I am only using the following firebase pods:

pod 'Firebase/Core', '~> 5.4'
pod 'Firebase/Auth', '~> 5.4'
pod 'Firebase/Firestore', '~> 5.4'

I am not using Firebase Analytics but I think it is bundled with the Firebase/Core pod.

Error message:

5.4.1 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -1200, Error Domain=NSURLErrorDomain Code=-1200 "Se ha producido un error de SSL y no puede establecerse una conexión segura con el servidor." UserInfo={NSErrorFailingURLStringKey=https://app-measurement.com/a, NSLocalizedRecoverySuggestion=¿Quieres conectarte al servidor de todos modos?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <699995C5-0868-4814-BE8C-4273D8CDBE63>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalUploadTask <699995C5-0868-4814-BE8C-4273D8CDBE63>.<1>"

The localized error message is written in Spanish. It says something like "An SSL error has been produced and it wasn't possible to establish a secure connection with the server."

I do not have Analytics enabled in my app and I don't reference it in any of my code. I want to implement this in the future, but while this happens ¿Can I stop getting this very annoying message?

Ad

Answer

According to Firebase documentation

Permanently deactivate collection

If you need to deactivate Analytics collection permanently in a version of your app, set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES in your app's Info.plist file.
Setting FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES takes priority over any values for FIREBASE_ANALYTICS_COLLECTION_ENABLED in your app's Info.plist as well as any values set with setAnalyticsCollectionEnabled.

Temporarily disable collection

AnalyticsConfiguration.shared().setAnalyticsCollectionEnabled(false)

Ad
source: stackoverflow.com
Ad