在 Flutter 中使用 Google Cloud pub sub 实现 MQTT

Dha*_*ara 6 mqtt dart google-cloud-platform iot flutter

有没有办法在flutter中建立与Google IoT pub-sub API的连接?

我试过这个库,但它没有我正在寻找的配置。

我有以下数据将用于建立连接:

{
  "type": ,
  "project_id": ,
  "private_key_id": ,
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": ,
  "client_id": ,
  "auth_uri": ,
  "token_uri": ,
  "auth_provider_x509_cert_url": ,
  "client_x509_cert_url": 
}
Run Code Online (Sandbox Code Playgroud)

Nir*_*iya 3

您可以在 flutter 应用程序中使用gcloud包。它提供对 Cloud Datastore、Cloud Storage 和 Cloud Pub/Sub 的支持。希望能帮助到你。

PS 不要使用任何第三方库来连接 Google 服务。它可能没有得到完全支持,或者可能随时停止工作。使用 Google 提供的库。此处列出了 Google PubSub 的其他客户端库。