Non-Fatal reports not logging

92 Views Asked by At

I am logging non fatal errors in my service file after a network request but it is not logging until i restart the app, that is when it gets logged in crashlytics is there a way i can log it immediately?

let err = NSError(domain: String(data: response.data!, encoding: .utf8) ?? "nil", code: response.response?.statusCode ?? 0, userInfo: ["Hello": "This is an info"])
Crashlytics.sharedInstance().recordError(err)
1

There are 1 best solutions below

0
Jake Lee On

It is not possible, as (emphasis mine):

When you log an NSError, the app does not immediately terminate. Because Crashlytics only sends the logged error report on the next app launch,

Source