Buda Florin
Buda Florin

Reputation: 665

Custom keys in Crashlytics seems to be lost between activities

I wanted to add custom keys in Crashlytics reports so I done something like this:

Activity 1:

Crashlytics.start(this);

Activity 2:

Crashlytics.setString(Constants.MY_KEY, "my value");

... Crashlytics.setString(Constants.MY_KEY, "my overwritten value");

Activity 3:

Crashlytics.getInstance().crash();

The problem is that there is no MY_KEY displayed in the crash info. ONLY if I set it in Activity 1 but is not getting overwritten on Activity 2.

Is there any workaround to make this work ?

Upvotes: 0

Views: 1083

Answers (1)

Fbarzin
Fbarzin

Reputation: 51

I don't see anything wrong with this approach. Just make sure your custom key in Activity 2 is read before crash happens. You can put a break point or log it to make sure the setString method is called.

Upvotes: 2

Related Questions