gpt4 book ai didi

android - Quickblox 错误 : "Unexpected Signature" while login ChatService in Android

转载 作者:行者123 更新时间:2023-11-29 17:25:20 25 4
gpt4 key购买 nike

我在我的 android 应用程序中集成了 Quickblox SDK V2.2.5,我发现当我们使用 SocialProviders 时聊天功能不正常,例如 FacebookTwitter

因此,当我们尝试登录 ChatService 时,在接收到所有必需的 Quickblox 单例类成功后,发生了导致它无法正常工作的确切错误。

以下是我的代码:-

QBAuth.createSession(new QBEntityCallbackImpl<QBSession>() {
@Override
public void onSuccess(final QBSession result, Bundle params) {
Log.e("QbAuth/onSuccess", "" + result);

QBUsers.signInUsingSocialProvider(QBProvider.FACEBOOK, preference.getFacebookToken(), null, new QBEntityCallbackImpl<QBUser>() {
@Override
public void onSuccess(final QBUser user, Bundle args) {
Log.e("Fb Login/onSuccess", "user: " + user.toString());

try {
user.setPassword(BaseService.getBaseService().getToken());
} catch (BaseServiceException e) {
e.printStackTrace();
// means you have not created a session before but we have created as we can see.
}
// Lets initialize ChatService if it's not done before.
ChatService.initIfNeed(context);

ChatService.getInstance().login(user, new QBEntityCallbackImpl() {
@Override
public void onSuccess() {
Log.e("ChatService/onSuccess",
"Logged in to Chat");
}

@Override
public void onError(final List errors) {
/** It's always been error here while we login **/
Log.e("ChatService Error", "" + errors);
}
});
}
});

try {
// User & password saving.
DataHolder.getDataHolder().setSignInQbUser(
user);
DataHolder
.getDataHolder()
.setSignInUserPassword(
BaseService
.getBaseService()
.getToken());
} catch (BaseServiceException e) {
e.printStackTrace();
}
}

@Override
public void onError(List<String> errors) {
Log.e("Fb Login/onError", "Error: "
+ errors);
}
});

}

@Override
public void onError(List<String> errors) {
Log.e("QbAuth/onError", "" + errors);
}
});

同样的日志是:-

01-20 12:18:37.657 28040-28040/com.myapp D/QBASDK:     POST https://api.quickblox.com/session.json?application_id=25290&auth_key=Mr3GJxYk6krKbQN&nonce=-1682323378&timestamp=1453272517&user[login]=_702514376540831&user[email]=haps%40india.com&user[password]=3731b3f7f4857202ce39516d677baf54bfbbd3aa&signature=6a5c8f377906d5e73852e838b488ef500c499bef  
*** RESPONSE *** a35fe359-229b-4663-b705-67d9e394eb7e ***
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: STATUS : 422
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: HEADERS
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Access-Control-Allow-Origin=*
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Cache-Control=no-cache
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Connection=keep-alive
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Content-Length=44
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Content-Type=application/json; charset=utf-8
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Date=Wed, 20 Jan 2016 06:48:38 GMT
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: QuickBlox-REST-API-Version=0.1.1
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Server=nginx/1.8.0
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: Status=422 Unprocessable Entity
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: X-Rack-Cache=invalidate, pass
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: X-Request-Id=102f5ea405e66ba568a7a5f5522b65de
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: X-Runtime=0.006373
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: X-UA-Compatible=IE=Edge,chrome=1
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: BODY
01-20 12:18:39.187 28040-28040/com.myapp D/QBASDK: '{"errors":{"base":["Unexpected signature"]}}'
01-20 12:18:39.187 28040-28040/com.myapp E/ChatService Error: [base Unexpected signature]

最佳答案

看起来您正在尝试使用用户的参数(例如登录名、密码和电子邮件)创建 session

你可以选择一个身份参数(登录名或电子邮件)并尝试使用它吗,不需要同时传递它们

关于android - Quickblox 错误 : "Unexpected Signature" while login ChatService in Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34893379/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com