Invalidating and switching SDK instances

Invalidate the SDK

Invalidating the Zendesk SDK will end its current instance. The invalidate() function now supports clearing the internal storage through a boolean parameter. When the parameter is set to true, it clears all non essential data to ensure this data doesn't accumulate over time. If clearing storage not intended to be performed during invalidation, it will be cleared when the end user logs out. The default value of the parameter is set to false to keep the previous behavior of the SDK. It is important to remember that once the Zendesk SDK is invalidated, no messages or notifications will be received.

Swift

Zendesk.invalidate(true)

Objective-C

[Zendesk invalidateClearStorage:YES];

Switching between instances

The Zendesk SDK enables switching between different instances at runtime, which is useful for running multiple instances within a single application. To use this feature, the invalidate function must be set to false.

Swift

Zendesk.invalidate(false)

Objective-C

[Zendesk invalidateClearStorage:NO];