ConnectyCube / connectycube-android-sdk-releases

Releases packages for ConnectyCube Android SDK platform
https://connectycube.com
8 stars 2 forks source link

Unable to create dialog #1

Closed mufit-developer closed 4 years ago

mufit-developer commented 4 years ago

Hi, I am having an issue creating a 1-1 dialog using the Android SDK. I have logged in successfully (ChatService.isLoggedIn()) returns true) but every time I call ConnectycubeRestChatService.createChatDialog().performAsync() it returns a 403 error. Did I miss something?

Error Log

D/CB-SDK: *******************
    * RESPONSE * 117cb906-dfb1-445f-8eb6-8e48f247927f *
    STATUS : 403 
    HEADERS
        Status=403 Forbidden
        Transfer-Encoding=chunked
        Server=nginx/1.12.1
        Access-Control-Allow-Origin=*
        X-Request-Id=22be0402-34ef-4d2b-8414-0398cb4d5c1a
        CB-Token-ExpirationDate=2019-10-21 06:24:48 UTC
        X-Content-Type-Options=nosniff
        X-Runtime=0.018619
        Connection=close
        X-Android-Received-Millis=1571631885303
        Date=Mon, 21 Oct 2019 04:24:48 GMT
        X-Frame-Options=SAMEORIGIN
        ConnectyCube-REST-API-Version=0.1.1
        X-Android-Selected-Protocol=http/1.1
        Strict-Transport-Security=max-age=31536000
        Cache-Control=no-cache
        X-Android-Response-Source=NETWORK 403
        Set-Cookie=_mkra_ctxt=edd1482c47772d5d6d42eab0658450d8--403; path=/; max-age=5; HttpOnly; secure
        X-Android-Sent-Millis=1571631884748
        X-XSS-Protection=1; mode=block
        Content-Type=application/json; charset=utf-8
    BODY
        '{"errors":{"base":["Forbidden. Need user."]}}'
dileepkumarbenbanshi commented 4 years ago

I found same error please help me

mufit-developer commented 4 years ago

@dileepkumarbenbanshi you need to call 2 signIn methods, I believe the first one is ConnectycubeUsers.signIn, followed by ConnectycubeChatService.signIn (can't remember what exactly they were called).

dileepkumarbenbanshi commented 4 years ago

i am using following code for connect

[CYBChat.instance connectWithUserID:[userCCID integerValue] password:password completion:^(NSError * _Nullable error) {

        }];
dileepkumarbenbanshi commented 4 years ago

Are you suggesting following signin method

[CYBRequest logInWithUserLogin:@"userLogin" password:@"userPassword" successBlock:^(CYBUser *user) {

} errorBlock:^(NSError *error) {

}];

dileepkumarbenbanshi commented 4 years ago

Solved my problem Thanks For your valuable Time