I wanted to send some custom keys for each crash, say a crash identifier to identify the user reported crash from crashlytics. I see the Crashlytics API provides a method setObjectValue(forkey:) to do this, but, where in code should this be called ? Do we have any Crashlytics callback that gets triggered when a crash happens? So far I have seen, there is only a callback to know whether crash happened during the last session.
You can add custom keys whenever you want, after initializing Crashlytics. The keys would be attached to any future crash during the life of the app.
You can have up to 64 key/value pairs (after that, they aren't saved). So if you sent into Crashlytics 64 key/value pairs, then later the app crashed, those 64 key/value pairs would be added info in the crash report which is created and sent to Fabric and Firebase at next launch of the app.
There are no callbacks due to a crash in the app session... the app crashed and thus terminated, after all! :)