Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
iOS 上的 Hub Activation API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
透過 Hub Activation API,您可以透過程式輔助方式探索及啟用 Google Home Hub。如果使用者無法透過其他方式啟動中樞裝置 (例如中樞裝置沒有螢幕),這項功能就特別實用。
使用 Hub Activation API
您可以使用 Hub Activation API 建構應用程式,以便探索及啟用中樞裝置。這個 API 是以 Home 類別的方法實作。
找出 Wi-Fi 網路中可做為中樞裝置的裝置:
import GoogleHomeSDK
// Find available hubs, with a 5-second timeout
let hubs = try await home.discoverAvailableHubs(duration: .seconds(5))
啟用支援中樞裝置的裝置:
try await home.startHubActivation(hub)
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-05-15 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["資訊不正確","incorrectInformation","thumb-down"],["資訊/範例不足","notEnoughInformationSamples","thumb-down"],["太複雜","tooComplicated","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-05-15 (世界標準時間)。"],[],[]]