在 Google Cloud Console 中创建服务账号

服务账号是一种特殊的 Google 账号,Adapty 将通过它访问你的 Google 项目和应用。

开始之前

在同一个 Google Cloud 项目中启用开发者 API。在 API 开启之前,服务账号没有任何可调用的接口。

创建服务账号

  1. 在 Google Cloud Console 中打开 IAM & Admin > Service accounts,确认你处于正确的项目中。

    Service accounts page in Google Cloud Console with the Create service account button
  2. 点击 Create service account

  3. 填写 Service account name,建议在名称中包含”Adapty”,以便清楚地标识该账号的用途。Service account ID 字段会自动填充。

  4. 复制该账号的电子邮件地址。您将使用它在 Play Console 中分配所需权限。

    Create service account form showing the name, ID, and generated email address
  5. 点击 Create and continue

  6. 为新创建的账号赋予 Pub/Sub Admin 角色。Adapty 需要该权限来接收实时开发者通知。点击 Select a role,然后选择 Pub/Sub > Pub/Sub Admin

Role picker in the Create service account wizard
  1. 为其分配 Monitoring Viewer 角色。Adapty 需要此角色来监控通知队列。点击 Add another role,然后选择 Monitoring > Monitoring Viewer

  2. 点击 Continue

  3. 跳过 Principals with access,然后点击 Done

下一步

在 Google Play Console 中为服务账号授予权限,以便其访问您的应用数据。