We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
注册时出现错误:code : 208 ,description : Registration failed.
注册模式:选择的是 开放注册
注册代码写在IO线程中 GlobalScope.launch(Dispatchers.Main) { try { withContext(Dispatchers.IO) { LogUtils.d("当前线程: ${Thread.currentThread().name} ") EMUtils.getInstance().createAccount(userName, passWord) } ...... } catch (e: HyphenateException) { LogUtils.e("code : ${e.errorCode} ,description : ${e.description}") val errorCode = e.errorCode if (errorCode == EMError.NETWORK_ERROR) {//网络异常 showToastMessage(getString(R.string.network_isnot_available)) } else if (errorCode == EMError.USER_ALREADY_EXIST) {//用户已经存在 showToastMessage(getString(R.string.User_already_exists)) } else if (errorCode == EMError.USER_AUTHENTICATION_FAILED) {//无权限 showToastMessage(getString(R.string.registration_failed_without_permission)) } else if (errorCode == EMError.USER_ILLEGAL_ARGUMENT) {//用户名不合法 showToastMessage(getString(R.string.illegal_user_name)) } else if (errorCode == EMError.EXCEED_SERVICE_LIMIT) {//App用户注册数量已达上限 showToastMessage(getString(R.string.register_exceed_service_limit)) } else {//注册失败 showToastMessage(getString(R.string.Registration_failed)) } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
注册时出现错误:code : 208 ,description : Registration failed.
注册模式:选择的是 开放注册

注册代码写在IO线程中
GlobalScope.launch(Dispatchers.Main) {
try {
withContext(Dispatchers.IO) {
LogUtils.d("当前线程: ${Thread.currentThread().name} ")
EMUtils.getInstance().createAccount(userName, passWord)
}
......
} catch (e: HyphenateException) {
LogUtils.e("code : ${e.errorCode} ,description : ${e.description}")
val errorCode = e.errorCode
if (errorCode == EMError.NETWORK_ERROR) {//网络异常
showToastMessage(getString(R.string.network_isnot_available))
} else if (errorCode == EMError.USER_ALREADY_EXIST) {//用户已经存在
showToastMessage(getString(R.string.User_already_exists))
} else if (errorCode == EMError.USER_AUTHENTICATION_FAILED) {//无权限
showToastMessage(getString(R.string.registration_failed_without_permission))
} else if (errorCode == EMError.USER_ILLEGAL_ARGUMENT) {//用户名不合法
showToastMessage(getString(R.string.illegal_user_name))
} else if (errorCode == EMError.EXCEED_SERVICE_LIMIT) {//App用户注册数量已达上限
showToastMessage(getString(R.string.register_exceed_service_limit))
} else {//注册失败
showToastMessage(getString(R.string.Registration_failed))
}
}
}
The text was updated successfully, but these errors were encountered: