Offline Crash Reporting in Crashlytics

Offline crash reporting in Crashlytics

Marc from Crashlytics here. If the app crashes without an active network connection, the report will still be caught! We always send crash reports on launch when there's an active connection. If that fails, we'll queue it to send later. :)

Android Crashlytics offline behaviour: When application have no internet accss

Firebaser here -

As mentioned in the comment to your main post by Công Hải, How does fabric handle being offline? still applies - crashes will be stored locally until there's a chance to upload them.

It will attempt to send those up as soon as two conditions are met - the app is relaunched after crashing and the device is connected to the internet.

crash reporter offline for android device offline

Technically, you can implement such mechanism to track the crash logs yourself.
check out the following piece of code to handle within Application class:

import android.app.Application

class TestApp : Application() {
override fun onCreate() {
super.onCreate()

val exceptionHandler = SimpleExceptionHandler()
Thread.setDefaultUncaughtExceptionHandler(exceptionHandler)
}
}

class SimpleExceptionHandler : Thread.UncaughtExceptionHandler {
override fun uncaughtException(thread: Thread, exc: Throwable) {
// Log your exception here to files, database, etc together with the device status like RAM, processes, network condition that the crash point
}
}

You can choose the way to store your information like text file, database, etc

iOS Crashlytics - Block crash reports from being send to server

Once the setting changes, you can make sure Crashlytics is not enabled once the app restarts. In your app delegate, you can check for the setting and then enable Crashlytics.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Crashlytics
//Check setting
if ([[NSUserDefaults standardUserDefaults] boolForKey: @"CanSendCrashReports"])
{
[Fabric with:@[[Crashlytics class]]];
}
}

Xcode 6.3 and Crashlytics / Other crash reporting tool

I have successfully used Crashlytics and turned on the feature for opted-in App Store users to send crash reports on iOS and receive crash logs in both areas. The same applies for our Android app on the Google Play store (where I use PhoneGap/Cordova 3.6.x)

I noticed, however, that Crashlytics will show significantly more crash logs than Apple's reportings (due to the nature of not opting-in) so I rely heavily still on Crashlytics for error reporting. The new feature in Xcode 6.3 is pretty neat for tracking crashes, but I personally haven't explored the feature in full detail.

To answer your question though - Yes you can have both on and they will both work seamlessly.

Also you should make the upgrade to Fabric if you haven't already, it's pretty painless now to do and if you ever need Twitter integration or analytics for Twitter ads in the future Fabric has it built-in.



Related Topics



Leave a reply



Submit