shags fato
shags fato

Reputation: 21

Non-Fatal reports not logging

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)

Upvotes: 1

Views: 107

Answers (1)

Jake Lee
Jake Lee

Reputation: 7989

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

Upvotes: 1

Related Questions