Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
iOS 上的 Hub 激活 API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Hub Activation API,您可以程序化地发现和激活 Google Home hub。当用户没有其他方式来激活 hub 时,此 API 特别有用,例如在 hub 没有屏幕的情况下。
使用 Hub Activation API
借助 Hub Activation API,您可以构建一个能够发现和激活 hub 的应用。此 API 以 Home 类的方法实现。
Home
识别 Wi-Fi 网络上的任何支持 hub 的设备:
import GoogleHomeSDK
// Find available hubs, with a 5-second timeout
let hubs = try await home.discoverAvailableHubs(duration: .seconds(5))
激活支持 hub 的设备:
try await home.startHubActivation(hub)
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-07-09。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["不正确的信息","incorrectInformation","thumb-down"],["信息/样本不足","notEnoughInformationSamples","thumb-down"],["太复杂","tooComplicated","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2026-07-09。"],[],[]]