Leave Conversation
This guide covers the process of leaving a conversation.
NOTE: A step-by-step tutorial to build a chat application is available here.
Given a conversation you are already a member of, you can stop being an active member of it by leaving the conversation:
conversation.leave()
conversation.kick("memberId", object : NexmoRequestListener<Any> {
override fun onSuccess(p0: Any?) {
Log.d("TAG", "User kick success")
}
override fun onError(apiError: NexmoApiError) {
Log.d("TAG", "Error: Unable to kick user ${apiError.message}")
}
})
conversation.kick("memberName", new NexmoRequestListener<Void>() {
@Override
public void onSuccess(@Nullable Void aVoid) {
Log.d("TTAG", "User kick success");
}
@Override
public void onError(@NonNull NexmoApiError apiError) {
Log.d("TTAG", "Error: Unable to kick user " + apiError.getMessage());
}
);
conversation.leave({ (error) in
if let error = error {
NSLog("Error leaving conversation: \(error.localizedDescription)")
return
}
NSLog("Conversation left.")
})
[self.conversation leave:^(NSError * _Nullable error) {
if (error) {
NSLog(@"Error leaving conversation: %@", error);
return;
}
NSLog(@"Conversation left.");
}];