Before proceeding with account authorization, make sure that you have:
- The Google Home app (GHA) installed on your mobile iOS device, set up with at least one home (structure) on your Google Account.
- At least one of these device types supported for the sample app
in the home:
- Color Temperature Light
- Dimmable Light
- Door Lock
- Extended Color Light
- Fan
- Occupancy Sensor
- On/Off Light
- On/Off Plug-in Unit
- Temperature Sensor
- Thermostat
- Window Covering
- Two devices for testing the sample automation.
Prior to using devices through the Home APIs, they must controllable from GHA.
Run the sample app
From the Xcode IDE, select a physical device to deploy.
The first time running it, you'll be asked to allow access to a home on your Google Account. This grants the sample app permission to access and control the structures and devices in that home.
The app's default permission behavior will differ depending on whether or not the app was registered on the Google Home Developer Console.
If an app is not registered in the Developer Console, it will be in an unverified state. This is recommended for testing use of the Home APIs:
Only users registered as test users in the OAuth console can grant permissions for the app. There is a limit of 100 test users for an unverified app.
An unverified app will have access to devices of any device types that are supported by OAuth for the Home APIs (the list of device types in the Developer Console). All devices in a structure will be granted.
If an app is registered in the Developer Console and has been approved for access to one or more device types, and brand verification has been completed for OAuth, it will be in a verified state. This state is required for launching an app to production:
- Test user limits no longer apply. Any user can grant permission to the app.
- The user can only grant permission to the device types that were approved in the Developer Console.
Tap Connect in the upper-right of the app.
- If there are any homes connected to your account, choose a home to
grant permission to. If no devices are
found in the chosen home, you can set up a device of your choosing in that
home using the Google Home app (GHA). Remember, only these device
types have support for control in this sample app:
- Color Temperature Light
- Dimmable Light
- Door Lock
- Extended Color Light
- Fan
- Occupancy Sensor
- On/Off Light
- On/Off Plug-in Unit
- Temperature Sensor
- Thermostat
- Window Covering
- If there are no homes connected to your account, you will need to set up a home. To do so, use the GHA. Then attempt to connect the sample app again.
The user of the app clicks Connect.
Allow google.com to be used for Sign In.
The user selects the Google Account to use.
The user selects a home to grant permissions for.
The user selects a home to grant permissions for.
The user is returned to the home view.
Once you have successfully granted permission to a home that features devices, you will be taken to the devices view. You can control the devices and observe their state changes through the sample app.