我正在尝试使用GooglePlayIntegrityAPI来验证完整性。
我的问题是3-4。(对不起,我弄错了) 图像。
GoogleServer将以下错误返回给MyAppServer。
"Code": 400,
"Message": "App is not found.",
"ErrorResponseContent": "
{
"error": {
"code": 400,
"message": "App is not found.",
"errors": [
{
"message": "App is not found.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
"原因是什么?顺便说一句,Android应用程序返回400坏请求(这是Appserver生成的错误,所以这并不重要)。
** UPDATE(2022/10/21) **
下面是我的代码,其中GoogleIntegrityAPI从AppServer(而不是从my AndroidApp)调用了。
var credentialJson = "...credential json...";
var credential = GoogleCredential.FromJson(credentialJson)
.CreateScoped(new[] { PlayIntegrityService.Scope.Playintegrity }).UnderlyingCredential;
var playIntegrityService = new PlayIntegrityService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "...application name..."
});
var requestBody = new DecodeIntegrityTokenRequest
{
IntegrityToken = "...token..."
};
var request = playIntegrityService.V1.DecodeIntegrityToken(requestBody, "...package name...");
var response = await request.ExecuteAsync();谢谢。
发布于 2022-10-28 10:04:53
这样啊,原来是这么回事!我错误地将我的安卓应用程序的ApplicationID作为ApplicationName传递到服务器端。ApplicationID和ApplicationName在原则上是相同的,但是我为ApplicationID添加了一个发展后缀。这就是为什么应用程序没有被找到的原因。
productFlavors {
create("aaa") {
dimension = "default"
}
create("bbb") {
dimension = "default"
applicationIdSuffix = ".bbb"
}
}我通过了com.sample.myapp.bbb,但我应该只使用com.sample.myapp。
谢谢。
https://stackoverflow.com/questions/74051874
复制相似问题