要检查应用内购买,我使用了此 API https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token} 并得到了此响应。
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"errors": [
{
"message": "Insufficient Permission",
"domain": "global",
"reason": "insufficientPermissions"
}
],
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"metadata": {
"method": "androidpublisher.ProductPurchasesService.Get",
"service": "androidpublisher.googleapis.com"
}
}
]
}
}
您的授权流程中偶然缺少完整的用户名
AuthorizationCodeInstalledApp(flow, receiver).authorize(_USER_ID + "@gmail.com");
如果我通过 AuthorizationCodeInstalledApp 使用“[电子邮件受保护]”,我可以发送邮件。但是我的日历 API 失败了(权限不足)。如果我将其更改回“用户”,则日历可以正常工作,但邮件不能正常工作。有什么建议吗?