Im trying to implement Crashlytics inside my iOS swift project and setting customValue for the crash report. What Im trying to achieve is the following:
The user gets asked for consent for sending crash logs
If the user agrees I set:
Crashlytics.crashlytics().setUserID("user-id") Crashlytics.crashlytics().setCustomValue("hello", forKey: "sayHi") Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
When the app crashes I want to be able to see the customValue in Crashlytics.
This doesn't seem to work. I get the crash report in Crashlytics but without the customValue.
What does work is if I set the customValue inside my test button like this:
@IBAction func testButtonTapped(_ sender: Any) {
Crashlytics.crashlytics().setCustomValue("Testing", forKey: "test")
fatalError()
}
Is there a way to set a global customValue that gets added to all crashes? (in my case I want to set the identifier of the organization unit that the user is in)
Im also having trouble viewing the userId inside Crashlytics. Is it supposed to be blurred like this? (see screenshot)