google-play - 启用通知/观看 Google Play 存储桶以编程方式下载报告

标签 google-play google-cloud-storage google-cloud-platform gsutil

有很多关于 how to programatically download Google Play reports 的新信息使用 gsutil工具。 Google Play 使用存储桶来存储这些报告,就像 Google Cloud Storage 一样。我已经能够毫无问题地从 Google Play 存储桶下载报告。例如:

gsutil cp gs://pubsite_prod_rev_<my project id>/stats/installs/installs_<my app id>_201502_overview.csv .

另一方面,gsutil 提供了一项功能 watch Google Cloud Storage buckets ,因此您可以在每次存储桶中的对象更改时收到通知 (gsutil notification watchbucket)。我还可以在我自己的 Google Cloud 项目中创建的存储桶中启用通知。

问题是,我无法在我的 Google Play 存储桶中启用通知。有可能吗?调用时出现 AccessDeniedException: 403 Forbidden 错误:

gsutil notification watchbucket -i playnotif -t sometoken https://notif.mydomain.com gs://pubsite_prod_rev_<my project id>
  • 我已完成所有步骤 here ,特别注意那些关于 identifying a domain to receive notifications 的人.
  • 正如我上面提到的,我已经能够完成我需要的所有过程,但使用的是我自己在 Google Cloud 中的存储桶,而不是 Google Play 存储桶。
  • Google Play 项目已关联到 Google Cloud 项目。当我启用 Google Play API 访问(Google Play 开发者控制台 -> 配置(左侧菜单) -> API 访问)时,它会自动执行此操作。
  • Google Play 项目所有者和我自己的 Google Cloud 项目所有者是同一个人。
  • 此所有者已成功注册并验证用于接收通知的域(在示例之后,我验证了两个以防万一:notif.mydomain.commydomain.com, 在 Google Webmaster Tools 中使用 https)
  • 这些域也已在 Google Developers Console 中列入白名单(左侧边栏 -> API 和授权 -> 推送)。
  • 我已使用项目所有者帐号或我创建的服务帐号在我自己的 Google Cloud 存储桶中成功启用通知。我已经尝试在 Google Play 存储桶中使用两者(所有者和相应的服务帐户),但没有成功。

任何想法将不胜感激。谢谢!

编辑:

我已经按照步骤操作了here ,但使用不同的程序(如以下评论中所述)。按照 Nikita 的建议,我尝试使用相同的步骤执行这些步骤。

所以我将 gsutil(通过 gcloud)配置为使用所有者帐户:

gcloud config set account owner-of-play-store-project@gmail.com

在尝试授予对服务帐户的完全访问权限时,我遇到了这个错误:

$ gsutil acl ch -u my-play-store-service-account@developer.gserviceaccount.com:FC gs://pubsite_prod_rev_my-bucket-id
CommandException: Failed to set acl for gs://pubsite_prod_rev_my-bucket-id/. Please ensure you have OWNER-role access to this resource.

因此,我尝试列出此存储桶的默认 ACL,并发现:

$ gsutil defacl get gs://pubsite_prod_rev_my-bucket-id
No default object ACL present for gs://pubsite_prod_rev_my-bucket-id. This could occur if the default object ACL is private, in which case objects created in this bucket will be readable only by their creators. It could also mean you do not have OWNER permission on gs://pubsite_prod_rev_my-bucket-id and therefore do not have permission to read the default object ACL.
[]

结论:

这真的让我觉得,即使使用项目所有者帐户,该帐户在 Play 商店存储桶上也没有 OWNER 角色。这意味着 ACL 无法修改,甚至无法列出,也无法启用通知,因为不幸的是,我们并不真正拥有该存储桶。

最佳答案

目前,您不能。 Google Play 拥有这些存储桶,最终用户没有订阅 Object Change Notifications 所需的存储桶 FULL_CONTROL 访问权限.

关于google-play - 启用通知/观看 Google Play 存储桶以编程方式下载报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28855617/

相关文章:

android - 可以在 google play store 上设置发布日期吗?

google-cloud-platform - 使用 python 中的访问 token 验证 Google Storage 对象

azure - Azure AD 是否与 GCP/GKE 集成以允许 SSO?

使用 gcsfuse 挂载谷歌存储时 Docker 构建失败

python - 通过云存储桶更改通过云功能发送邮件

google-cloud-platform - 在 gcp 中限制用户对 VM 的访问

android - 尝试发布我的应用时,Google Play 中的商品详情未激活

android - 将应用程序上传到 Playstore 时,错误 googleapi : Error 403: Forbidden, azure devops 的 CI-CD 管道抛出错误

android - 使用 flavor 在 AppGallery 和 Google Play 上发布应用

node.js - 使用 Google Functions 和 Node JS 10 复制整个源文件夹而不仅仅是触发器文件