gpt4 book ai didi

java - Spotify 安卓 SDK : INVALID_APP_ID

转载 作者:太空宇宙 更新时间:2023-11-03 10:37:07 24 4
gpt4 key购买 nike

final AuthenticationRequest request = new AuthenticationRequest.Builder(CLIENT_ID, AuthenticationResponse.Type.TOKEN, REDIRECT_URI)
.setScopes(new String[]{"playlist-read"})
.build();

AuthenticationClient.openLoginActivity(this, REQUEST_CODE, request);

上面是点击登录按钮后运行的代码。此代码在模拟器上运行时运行良好。下面是 onActivityResult:

if (requestCode == REQUEST_CODE) {
AuthenticationResponse response = AuthenticationClient.getResponse(resultCode, intent);
switch (response.getType()) {
// Response was successful and contains auth token
case TOKEN:
logMessage("Got token: " + response.getAccessToken());
CredentialsHandler.setToken(this, response.getAccessToken(), response.getExpiresIn(), TimeUnit.SECONDS);
startMainActivity(response.getAccessToken());
break;

// Auth flow returned an error
case ERROR:
logError("Auth error: " + response.getError());
break;

// Most likely auth flow was cancelled
default:
logError("Auth result: " + response.getType());
}
}

当应用程序在安装了 Spotify 应用程序的设备上运行时,response.getType() 返回错误,response.getError() 为 INVALID_APP_ID。

我的应用程序包名称和 SHA-1 指纹在 Spotify 的开发门户中输入,这应该不是问题,因为它可以在模拟器上运行。为什么不在响应中发送 token ?提前致谢!

PS:澄清一下,这不是 Spotify API: INVALID_APP_ID 的副本

帖子的回答是把SHA-1指纹和包名放到portal里,我已经这么做了。

最佳答案

您应该在 https://developer.spotify.com/dashboard/ 上的项目设置中添加(调试和发布)SHA1 指纹和包名.

参见 https://developers.google.com/android/guides/client-auth寻求有关如何获取 SHA1 的帮助。

关于java - Spotify 安卓 SDK : INVALID_APP_ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41787548/

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