Hub Activation API on iOS

The Hub Activation API lets you programmatically discover and activate a Google Home hub. It is especially useful when the user has no other way to activate a hub, as in the case of a hub that lacks a screen.

Use the Hub Activation API

Using the Hub Activation API, you can build an app that can discover and activate hubs. This API is implemented as methods on the Home class.

  1. Identify any hub-capable devices on the Wi-Fi network:

    import GoogleHomeSDK
    
    // Find available hubs, with a 5-second timeout
    let hubs = try await home.discoverAvailableHubs(duration: .seconds(5))
    
  2. Activate a hub-capable device:

    try await home.startHubActivation(hub)