Shutdown API in Kotlin SDK Alpha

Learn about the Shutdown API available in the Kotlin SDK.

This guide walks you through the shutdown API provided by the Kotlin SDK.

Overview

The Kotlin SDK provides a shutdown API that lets you:

  • Stop all the operations
  • Remove all plugins, and
  • Free up the resources associated with the analytics instance initialized by the SDK.

Method definition

The following snippet highlights how to use the shutdown API:

analytics.shutdown()
warning
The shutdown operation is irreversible. The Analytics instance cannot be used further once it is shut down.

Note that:

  • All events recorded up to the shutdown point are written to disk but they are only flushed after the next initialization.
  • No saved data is lost - any data that persists on disk is processed upon the next SDK initialization.
  • All the SDK APIs will stop working once an Analytics instance is shut down and any API call will log an error. Also, any getter API call will return null.

Questions? Contact us by email or on Slack