After logging out of IM using the disconnect method, you can call connect to log in again. After calling getInstance, a persistent connection will be established automatically without calling connect
nim.disconnect({
done: function() {
nim.connect()
}
})
Disconnect from the server and destroy the IM instance If the instance is destroyed, you cannot call connect to reconnect to the chat room.
Note that in NIM SDK v9.9.0 and earlier versions, the ondisconnect callback function will be triggered directly after calling destroy, but the persistent connection is not actually closed. Only when the done callback is triggered, can the persistent connection be truly closed. To avoid device exclusion during reconnection, you must set reconnection and other operations in the done callback for the destroy method.
done callback. You must code the callback based on the requirements.
Disconnect from the server, but do not destroy the IM instance After logging in by calling connect, the data will be incrementally synchronized based on the instance status
Note that in NIM SDK v9.9.0 and earlier versions, the ondisconnect callback function will be triggered directly after calling destroy, but the persistent connection is not actually closed. Only when the done callback is triggered, can the persistent connection be truly closed. To avoid device exclusion during reconnection, you must set reconnection and other operations in the done callback for the destroy method.
done callback. You must code the callback based on the requirements.
log out of other devices using the same account.
Log out the account on other devices
done callback. You must code the callback based on the requirements.
Update the initialization parameters of the original NIM instance. The configurable parameters are the same as those of the NIM.getInstance method.
Any scenario that needs to update parameters for initialization. For example:
Basic interface definition for NIM instance