gpt4 book ai didi

java - Linkedin Android SDK - 无法连接到 API (INVALID_REQUEST)

转载 作者:搜寻专家 更新时间:2023-10-30 19:46:59 24 4
gpt4 key购买 nike

我在连接到 Linkedin API 时遇到了一些问题。

我正在关注这个 https://developer.linkedin.com/docs/android-sdk还有这个https://developer.linkedin.com/docs/android-sdk-auth ,但我收到此错误代码:

{
"errorCode": "INVALID_REQUEST",
"errorMessage": "either bundle id or package name \/ hash are invalid, unknown, malformed"
}

到目前为止,我的实现非常简单:

public void shareOnLinkedin() {

AuthListener authListener = new AuthListener() {
@Override
public void onAuthSuccess() {
Log.d(TAG, "Success");
}

@Override
public void onAuthError(LIAuthError error) {
Log.d(TAG, error.toString());
}
};

LISessionManager
.getInstance(getApplicationContext())
.init(ColectionDetailActivity.this, buildScope(), authListener, true);
}

private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE, Scope.W_SHARE);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
...

try {
LISessionManager.getInstance(getApplicationContext())
.onActivityResult(this, requestCode, resultCode, data);
} catch (Exception e) {
e.printStackTrace();
}
}

最佳答案

确保您已在 LinkedIn Developer Console 中正确添加所有包哈希。

Generating a debug key hash value


它在 Mobile 下,看起来像这样,

将使用 LinkedIn SDK 的应用程序包:com.mypackage.app

生成的包哈希:/i17lYLZpSffk1wdD+KzlRJroZU=

关于java - Linkedin Android SDK - 无法连接到 API (INVALID_REQUEST),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32429070/

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