genghiskhan genghiskhan - 1 year ago 86
iOS Question

Firebase Anonymous Login fails after Xcode Update

My anonymous login for Firebase was working for months; however, when Xcode forced me to install some updates, it couldn't find some pods. After deleting those pods after running pod update, the project will now build; however, while attempting the anonymous login, I get this error:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

If I wait long enough, I get error messages like this:

[Client] Discarding message for event <private> because of too many unprocessed messages

Here is my login method:

func login(onCompletion: @escaping (NSError?) -> Void) {
print("authenticating user")
FIRAuth.auth()?.signInAnonymously(completion: { result, error in
guard error == nil else {
print("error while authenticating user")

if let user = result {
self.defaults.set(user.uid, forKey: "uid")
} else {

which is called in the root view controller's viewDidLoad.

Answer Source

I still don't know what the issue was, but it was specific to the project. I created a new project and pulled the code from github and now it works like normal.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download