Package 

Class OtelCrashUploader


  • 
    public final class OtelCrashUploader
    
                        

    Purpose: This reads a local crash report files created by OneSignal's crash handler and sends them to OneSignal on the app's next start.

    This is fully platform-agnostic and can be used in KMP projects. All platform-specific values are injected through IOtelPlatformProvider.

    Dependencies (all platform-agnostic):

    • IOtelOpenTelemetryRemote: For network export (created via OtelFactory)

    • IOtelPlatformProvider: Injects all platform values (Android/iOS)

    • IOtelLogger: Platform logging interface (Android/iOS)

    Usage:

    val uploader = OtelFactory.createCrashUploader(platformProvider, logger)
    coroutineScope.launch {
        uploader.start()
    }
    • Method Summary

      Modifier and Type Method Description
      final Unit start() Starts the crash uploader process.
      final Unit internalStart() NOTE: sendCrashReports is called twice for the these reasons:
      • We want to send crash reports as soon as possible.

      • Reports could be delayed until the 2nd start after a crash

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • start

         final Unit start()

        Starts the crash uploader process. This will periodically check for crash reports on disk and upload them to OneSignal. If remote logging is disabled (NONE level), this function returns immediately without doing anything.

      • internalStart

         final Unit internalStart()

        NOTE: sendCrashReports is called twice for the these reasons:

        • We want to send crash reports as soon as possible.

        • Reports could be delayed until the 2nd start after a crash