Firebase Crashlytics

Integrating LogRocket with Firebase Crashlytics

LogRocket's getSessionUrl method allows you to register a callback that will receive the session URL as a parameter. That LogRocket session URL can then be attached to Crashlytics crash reports as a custom key:

SDK.getSessionURL { sessionURL in
  Crashlytics.crashlytics().setCustomValue(sessionURL, forKey: "LogRocket_session")                  
}
void (^completion)(NSString*) = ^(NSString* sessionURL) {
  [[FIRCrashlytics crashlytics] setCustomValue:sessionURL forKey:@"LogRocket_session"];
}

[LROSDK getSessionURL:completion]
SDK.getSessionURL(sessionUrl -> {
  FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
  crashlytics.setCustomKey("LogRocket_session", sessionUrl);
});