Firebase Crashlytics

Integration

Smartlook can be easily integrated into Crashlytics using Notifications:

NotificationCenter.default.addObserver(forName: Session.urlDidChangeNotification, object: nil, queue: nil) 
{ notification in
	if let smartlook = notification.object as? Smartlook,
 		 let sessionUrl = smartlook.user.session.url {
       
			Crashlytics.crashlytics().setCustomValue(sessionUrl, forKey: "Smartlook session URL") 	}
 	}
}

NotificationCenter.default.addObserver(forName: User.urlDidChangeNotification, object: nil, queue: nil) 
{ notification in
	if let smartlook = notification.object as? Smartlook {
    let visitorUrl = smartlook.user.url

     Crashlytics.crashlytics().setCustomValue(visitorUrl, forKey: "Smartlook visitor URL")
  }
}

Then in the Crashlytics dashboard, there should be a new Smartlook session URL key-value pair with a link to your Smartlook dashboard. Once opened, you can directly play the recording just before the crash occurred.

1244

Full Firebase Crashlytics documentation can be found on the official website.