【问题标题】:gsheets flutter how to add credentialsgsheets颤动如何添加凭据
【发布时间】:2020-09-09 03:40:06
【问题描述】:

我正在尝试集成 Flutter gsheets(用于使用 Google Sheets API v4 的库。)它说要添加

    const _credentials = r'''
  {
  "type": "service_account",
  "project_id": "",
  "private_key_id": "",
  "private_key": "",
  "client_email": "",
  "client_id": "",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": ""
}
''';
// your spreadsheet id
const _spreadsheetId = '';

这里我不确定如何使用它。我已按照 gsheets 库文档中有关入门和步骤的说明启用了所有 API。不幸的是,我只是不确定从哪里获得详细信息。

在互联网上找不到太多参考。请帮忙

【问题讨论】:

    标签: flutter dart google-sheets flutter-dependencies dart-pub


    【解决方案1】:

    您可以从 Google 创建一个服务帐户,它会为您提供一个包含您正在寻找的凭据的 json 文件。 Google 在此处发布了一些说明:[https://support.google.com/a/answer/7378726?hl=en][1] [1]:https://support.google.com/a/answer/7378726?hl=en。

    请确保您谨慎使用这些凭据并将其保密;它们包含有关您的服务帐户的一些信息,您不想与公众分享。

    【讨论】:

      猜你喜欢
      • 2021-09-20
      • 2016-12-17
      • 1970-01-01
      • 2019-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      相关资源
      最近更新 更多