Shutdown and Draining
Learn more about the default behavior of our SDK if the application shuts down unexpectedly.
The default behavior of most SDKs is to send out events over the network asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
The Apple SDK automatically stores the Sentry events on the device's disk before shutdown.
There are times where you may need to manually call close()
to ensure that events are sent before the app terminates. For example, if an app user revokes some privacy consent and the app can't use Sentry anymore, calling close()
will still send the events to Sentry.
Copied
SentrySDK.close()
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").