Skip to content
New issue

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

Application key or UserId as request body or device key as header not passed #24

Closed
achinverma opened this issue Dec 31, 2020 · 5 comments

Comments

@achinverma
Copy link

achinverma commented Dec 31, 2020

Hi, I am getting the below error in this code. I am using below version for my android project

kommunicate_flutter_plugin: ^1.1.2

void loginUser(context) {
    dynamic user = {
      'userId': 'achin_1789',
      'password': 'qwerty',
      'appId': APP_ID
    };

    KommunicateFlutterPlugin.login(user).then((result) {

      print("----Login successful---- : " + result.toString());
    }).catchError((error) {
      print("----Login failed---- : " + error.toString());
    });
  }

### API RESPONSE

Calling url: https://api.kommunicate.io/users/v2/chat/plugin/settings?appId=3fa16425bc95756a95d34b6ec6710c56d
I/HttpRequestUtils(17491): Calling url: https://chat.kommunicate.io/rest/ws/register/refresh/token
W/System  (17491): Ignoring header Device-Key because its value was null.
I/HttpRequestUtils(17491): Response : {"status":"error","errorResponse":[{"errorCode":"AL-GE-01","description":"Application key or UserId as request body or device key as header not passed","displayMessage":"Unable to process"}],"generatedAt":1609410786739}
I/HttpRequestUtils(17491): Response :{"code":"SUCCESS","response":{"userName":"Lively Krill","agentId":"[email protected]","agentName":"Achin Verma","chatWidget":{"fileUpload":"awsS3Server","notificationTone":"subtle","botMessageDelayInterval":1000},"collectFeedback":true,"customerCreatedAt":"2020-12-30T12:02:59.000Z","chatPopupMessage":[]}}
I/RegisterUserClient(17491): Net statustrue
I/RegisterUserClient(17491): Registration json {"chatNotificationMailSent":true,"appVersionCode":112,"applicationId":"3fa16425bc95756a95d34b6ec6710c56d","authenticationTypeId":0,"deviceType":1,"emailVerified":true,"enableEncryption":false,"hideActionMessages":true,"password":"Qwerty@123","prefContactAPI":2,"roleName":"USER","roleType":3,"skipDeletedGroups":true,"timezone":"Asia/Kolkata","userId":"achin_1789","userIdRegex":"^[a-zA-Z0-9_+#@.?|\u003d;-]+$"}
I/HttpRequestUtils(17491): Response: {"message":"PASSWORD_INVALID","currentTimeStamp":1609410788882,"deactivate":false,"totalUnreadCount":0,"metadata":{},"newUser":false}
I/RegisterUserClient(17491): Registration response is: {"message":"PASSWORD_INVALID","currentTimeStamp":1609410788882,"deactivate":false,"totalUnreadCount":0,"metadata":{},"newUser":false}
I/KmConversationHelper(17491): Error while logging in user : RegistrationResponse{message='PASSWORD_INVALID', deviceKey='null', userKey='null', userId='null', contactNumber='null', lastSyncTime=null, currentTimeStamp=1609410788882, displayName='null', notificationResponse='null', brokerUrl='null', imageLink='null', statusMessage='null', encryptionKey='null', userEncryptionKey='null', enableEncryption=false, metadata={}, roleType=null, authToken='null', pricingPackage=1, notificationAfter=null}
I/flutter (17491): --------Conversation builder error occurred : PlatformException(Error, RegistrationResponse{message='PASSWORD_INVALID', deviceKey='null', userKey='null', userId='null', contactNumber='null', lastSyncTime=null, currentTimeStamp=1609410788882, displayName='null', notificationResponse='null', brokerUrl='null', imageLink='null', statusMessage='null', encryptionKey='null', userEncryptionKey='null', enableEncryption=false, metadata={}, roleType=null, authToken='null', pricingPackage=1, notificationAfter=null}, null, null)
@achinverma
Copy link
Author

Hi, @reytum , @Sunilkumarr , @archit2602 , Pls can you guide me to fix this error

@reytum
Copy link
Contributor

reytum commented Dec 31, 2020

@achinverma
Please change the plugin name to:
kommunicate_flutter . Check the docs for more details: https://docs.kommunicate.io/docs/flutter-installation.html

@achinverma
Copy link
Author

@achinverma
Please change the plugin name to:
kommunicate_flutter . Check the docs for more details: https://docs.kommunicate.io/docs/flutter-installation.html

Hi @reytum , I am using the same. Pls have a look at the image.
image

@reytum
Copy link
Contributor

reytum commented Dec 31, 2020

@achinverma looks like you passed a password for the user earlier and now the password is wrong. Please try with a new user without any password. If you are passing password, then make sure you use the same password everytime.

@achinverma
Copy link
Author

Hi, @reytum , Let me check this. Thanks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants