Kill SDK
completely terminate the sdk kindlysdk kill() the kill() method completely terminates the sdk and clears all state this is more destructive than endchat() end chat md which only disconnects the chat session what kill() does when you call kill() , the sdk will ๐ disconnect the chat session (same as endchat() ) ๐งน clear all session data including messages and context โก reset sdk initialization state ๐ clear bot key and authentication ๐จ reset configuration and themes ๐ก emit termination events for cleanup after calling kill() after calling kill() , the sdk returns to an uninitialized state โ you cannot call launchchat() or other sdk methods โ
you must call start() again before using any sdk functions โ
all configuration (themes, permissions, etc ) needs to be set up again usage examples complete sdk shutdown // terminate the sdk completely kindlysdk kill() println("โ
sdk completely terminated") // sdk is now in uninitialized state switch to different bot (alternative method) // method 1 using kill() for explicit control kindlysdk kill() // sdk is now uninitialized must call start() again kindlysdk start( application = this, botkey = "new bot key", languagecode = "en", market = "your market" ) kindlysdk launchchat(context = this) // method 2 automatic switching (recommended) kindlysdk start( application = this, botkey = "new bot key", // sdk handles cleanup automatically languagecode = "en", market = "your market" ) kindlysdk launchchat(context = this) when to use kill() vs endchat() use kill() when ๐ app shutdown terminating the app or major state changes ๐ complete reset need to clear all sdk state and start fresh ๐ error recovery recovering from sdk errors or corruption ๐งช testing ensuring clean state between test runs use endchat() when ๐ฌ end conversation user finishes chatting but may return later ๐ temporary disconnect preserving sdk state for quick reconnection ๐ฏ normal flow standard chat lifecycle management comparison method session sdk state bot key config next action endchat() โ cleared โ
preserved โ
preserved โ
preserved launchchat() kill() โ cleared โ reset โ cleared โ reset start() required synchronous operation the kill() method completes synchronously , ensuring all cleanup is finished before returning kindlysdk kill() // safe to reinitialize immediately after this line kindlysdk start( application = this, botkey = "new bot key", languagecode = "en", market = "your market" ) best practices safe to call immediately after kill() kindlysdk kill() // immediately safe to reinitialize kindlysdk start(application = this, botkey = "new bot", market = "your market") use automatic bot switching instead of manual kill/start when possible // preferred automatic cleanup kindlysdk start(application = this, botkey = "new bot", market = "your market") // instead of manual cleanup kindlysdk kill() kindlysdk start(application = this, botkey = "new bot", market = "your market") handle errors gracefully in production apps try { kindlysdk kill() // continue with app flow } catch (e exception) { log e("sdk", "kill failed, but continuing", e) } thread safety the kill() method is thread safe and can be called from any thread however, subsequent sdk operations should follow the main thread requirements of the android sdk for normal chat lifecycle management, prefer endchat() end chat md over kill()