Shutdown API in Mobile SDKs

Learn about the Shutdown API available in the Kotlin and Swift SDKs.

This guide walks you through the shutdown API provided by the Kotlin and Swift SDKs.

Overview

The RudderStack Kotlin and Swift SDKs provide 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 sections highlight how to use the shutdown API:

Kotlin

Swift

Considerations

Note the following before using the shutdown API:

  • The shutdown operation is irreversible — the Analytics instance cannot be used further once it is shut down.
  • All SDK APIs will stop working once the Analytics instance is shut down and any API call will log an error. Also, any getter API call will return null.
  • 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.

Questions? Contact us by email or on Slack