Issue while launching conversation
Closed this issue · 16 comments
I get following error while launching conversation :
Registration response is: {"message":"PASSWORD_INVALID","currentTimeStamp":1618334956706,"deactivate":false,"totalUnreadCount":0,"metadata":{},"newUser":false}
My code :
fun openConversation(context: Activity, onLoading: ((isLoading:Boolean) -> Unit)?=null, onError:((error:Throwable?, showError:Boolean)->Unit)?=null) {
var messageMetaData= mutableMapOf<String, String>()
var sessionId= MyApplication.instance?.preferencesManager?.getSessionId()
var userId=MyApplication.instance?.preferencesManager?.getCachedUser()?.customer_id
var emailId=MyApplication.instance?.preferencesManager?.getCurrentUserEmail()
var suite=MyApplication.instance?.preferencesManager?.getCachedUser()?.suite
if(!(validateCredentials(userId,emailId,suite))){
onError?.invoke(null, true)
return
}
onLoading?.invoke(true)
var user = KMUser()
user.userId= userId
// user.userName=suite
user.email = emailId
user.password=APPConstants.KOMMUNICATE_PASSWORD
messageMetaData.put("defaultMessageMetaData","{\"userId\":\""+sessionId+"\"}")
var kmConversationBuilder :KmConversationBuilder
if(Kommunicate.isLoggedIn(context))
kmConversationBuilder= KmConversationBuilder(context)
else
kmConversationBuilder=KmConversationBuilder(context).setAppId(APPConstants.KOMMUNICATE_APP_ID)
.setKmUser(user)
kmConversationBuilder
.launchConversation(object : KmCallback {
override fun onSuccess(message: Any) {
onLoading?.invoke(false)
}
override fun onFailure(error: Any) {
onLoading?.invoke(false)
onError?.invoke(null, true)
}
})
}
any chance that you tried to login with account present in your teammates list?
PASSWORD_INVALID comes for 2 reasons:
- while initializing the user, you have set the password for the userId earlier, and that password is not matching with the one passed now.
- you are trying to login using the same user Id which is already present in the teammates section https://dashboard.kommunicate.io/settings/team Those users login will not work from the SDK for security reasons as your team who have access to dashboard, chat history, etc requires password to get access to the data.
Thanku very much for reply. I may have created this user earlier with different password. But i have deleted this user from admin. I can not find this userid now there. Why i am still facing this problem ?
User id/email i am logging with is not from Team List
Thanku very much for reply. I may have created this user earlier with different password. But i have deleted this user from admin. I can not find this userid now there. Why i am still facing this problem ?
are you facing the same issue if you try with another userId?
Let me check that. Could you help me with following questions:
-Do we need to set password while registering user?
-What are right steps to launch chat?
Let me check that. Could you help me with following questions:
-Do we need to set password while registering user?
-What are right steps to launch chat?
-Do we need to set password while registering user?
It is optional, if you are randomly generating the userId such as UUID or something which can't be guessed, then password is not required in such cases. But if you are planning to use a specific user identifier such as email as userID, then it is advisable to use the password.
-What are right steps to launch chat?
Register user https://docs.kommunicate.io/docs/android-authentication#registrationlogin
Open conversation https://docs.kommunicate.io/docs/android-conversation
Devashish , I tested lot and found that if you delete user from backend then you try to register again with that deleted userId then you face this "Invalid Password" issue in my case. Can you do something about it?
Devashish , I tested lot and found that if you delete user from backend then you try to register again with that deleted userId then you face this "Invalid Password" issue in my case. Can you do something about it?
yes that's right, let me check if there is any workaround. Also, could you please help me understand the reason to delete the user, was it related to some user spamming the system, or it was delete by mistake?
No it was not spam we are developing the system yet. User got registered with wrong parameters. I thought lets delete and register again.
No it was not spam we are developing the system yet. User got registered with wrong parameters. I thought lets delete and register again.
thanks for sharing the details, for this particular user, you can share the userId with us and we will activate the user again.
The behaviour you are seeing it is intentional, lets say a user starts sending spam messages, and the agent decides to delete the user so that they can't start the chat from the same browser now. Or if the development team used the user record for testing purpose and now decided to delete the user record before going live in production.
Ok Thanks Devashish.
@devashishmamgain
Sir, I am facing the same issue can you please provide me guidance on how to solve it.
I am implementing the flutter app using package when I created the user I forgot to give him a name so I deleted the user from the backend and now facing the same password invalid error. And I also didn't give password to the user.
@AkashMore7427
Can you please share your APP ID?
You can find the app id here: https://dashboard.kommunicate.io/settings/install
@rajeev-kommunicate
Do I need to share the APP ID here?
Kindly share the App Id on Email: support@kommunicate.io
@rajeev-kommunicate
Please Check I have sent you an email.