Other versions of this page
Crash Reporting
By design, DeepMedia SDKs do not communicate through the network. This means that we do not collect any kind of usage metrics and analytics, not even for the purpose of improving the product stability.
This means that we need your help to identify potential problems:
- the SDKs are designed to store debugging and crash information on disk
- you have the option to collect them and send them to us
Enable Crash Detection
If you are aware of a SDK-related problem, you can enable crash detection with the enableCrashDetection()
API.
Crash detection should be enabled cautiously, as a debugging tool designed for developers:
- First, enable it on your developer machine in debug builds
- If the issue can't be reproduced, enable it on selected devices and/or conditions and/or users
- If the issue can't be reproduced, enable it unconditionally, then disable it on next release
kotlinDeepMedia.enableCrashDetection(installSignalHandlers = false) { crashReport ->
// Do something with it, e.g. upload or save to disk...
uploadCrashReport(crashReport.title, crashReport.content) // defined by you
saveCrashReportToDisk(crashReport.title, crashReport.content) // defined by you
// Return true if you handled it, false if something went wrong and you want to receive it again
true
}
swiftDeepMedia.shared.enableCrashDetection(installSignalHandlers: false) { crashReport in
// Do something with it, e.g. upload or save to disk...
uploadCrashReport(crashReport.title, crashReport.content) // defined by you
saveCrashReportToDisk(crashReport.title, crashReport.content) // defined by you
// Return true if you handled it, false if something went wrong and you want to receive it again
true
}
Note:
- It is very important to return true if you handled the report, otherwise you will receive it multiple times.
- In most cases, crash reports will be passed to your function the next time you open the app.
- You can decide how to share the report with us. For instance, on a dev machine, you may save it to disk and share the file.
Signal handlers
The installSignalHandlers
boolean enables or disables signal handling as part of the crash detection.
If true, the SDK will use POSIX sigaction()
system call to register callbacks for common signals like SIGABRT
, SIGSEGV
, SIGBUS
.
This is optional because:
- It may conflict with other libraries using signals, like crash reporting SDKs
- It may catch crashes caused by your own code, unrelated to DeepMedia SDKs
We recommend enabling this flag only if you can't catch the error with the flag turned off.
Disable Crash Detection
In rare cases, you may want to disable crash detection after enabling it. You can do so with the disableCrashDetection()
API.
kotlinDeepMedia.disableCrashDetection()
swiftDeepMedia.shared.disableCrashDetection()