iOS 上的 Hub 激活 API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Hub Activation API,您可以程序化地发现和激活 Google Home 中枢。如果用户无法通过其他方式激活中枢(例如中枢没有屏幕),此方法就特别有用。
使用 Hub Activation API
借助 Hub 激活 API,您可以构建能够发现和激活 Hub 的应用。此 API 以 Home 类的方法形式实现。
识别 Wi-Fi 网络中支持中枢的设备:
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):2025-11-03。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["不正确的信息","incorrectInformation","thumb-down"],["信息/样本不足","notEnoughInformationSamples","thumb-down"],["太复杂","tooComplicated","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-11-03。"],[],[]]