Приложение Флип

После внедрения OAuth 2.0 вы можете при желании настроить App Flip на основе OAuth, что позволит пользователям Android быстрее связывать свои учётные записи в вашей системе аутентификации с учётными записями Google. В следующих разделах описывается, как разработать и реализовать App Flip для интеграции Cloud-to-cloud .

Design guidelines

This section describes the design requirements and recommendations for the App Flip account linking consent screen. After Google calls your app, your app displays the consent screen to the user.

Requirements

  1. You must have a Google authorization statement such as "Once linked, Google will have permission to control your devices."
  2. You must communicate that the user's account is being linked to Google, not to a specific Google product, such as Google Home or Google Assistant.
  3. You must state a clear call-to-action on your consent screen and use the wording "Agree and link" for linking action. This is because users need to understand what data they're required to share with Google to link their accounts.
  4. You must provide a way for users to go back or cancel, if they choose not to link. Use the wording "Cancel" for the cancel action.
  5. You must implement this workflow: After clicking "Agree and link", you must show linking success and redirect the user back to the Google Home app automatically. The user should now see the linked device on the Google Home app with your action. After clicking "Cancel" you should redirect the user back to the Google Home app.

Recommendations

We recommend that you do the following:

  1. Display Google's Privacy Policy. Include a link to Google's Privacy Policy on the consent screen.

  2. Data to be shared. Use clear and concise language to tell the user what data of theirs Google requires and why.

  3. Ability to unlink. Offer a mechanism for users to unlink, such as a URL to their account settings on your platform. Alternatively, you can include a link to Google Account where users can manage their linked account.

  4. Ability to change user account. Suggest a method for users to switch their account(s). This is especially beneficial if users tend to have multiple accounts.

    • If a user must close the consent screen to switch accounts, send a recoverable error to Google so the user can sign in to the desired account with OAuth linking and the implicit flow.
  5. Include your logo. Display your company logo on the consent screen. Use your style guidelines to place your logo. If you wish to also display Google's logo, see Logos and trademarks.

This figure shows an example consent screen with call-outs to the
            individual requirements and recommendations to be followed when
            you design a user consent screen.
Figure 1: Account linking consent screen design guidelines.

Настройка App Flip на основе OAuth

В следующих разделах описываются предварительные условия для App Flip на основе OAuth и порядок настройки проекта App Flip в консоли разработчика Google Home.

Создайте интеграцию «облако-облако» и настройте сервер OAuth 2.0

Прежде чем настраивать App Flip , необходимо сделать следующее:

Настройте App Flip в консоли разработчика

В следующем разделе описывается, как настроить App Flip в консоли разработчика .

  1. Заполните все поля в разделе «Информация о клиенте OAuth» . (Если App Flip не поддерживается, в качестве резервного варианта используется обычный OAuth.)
  2. В разделе Использовать приложение для привязки аккаунта (необязательно) установите флажок Включить для iOS .
  3. Заполните поле «Универсальная ссылка» . Подробнее об универсальных ссылках см. в статье «Разрешение приложениям и веб-сайтам ссылаться на ваш контент» .
  4. Если вы хотите дополнительно настроить свой клиент, добавьте области и нажмите «Добавить область» в разделе «Настройка клиента» (необязательно).
  5. Нажмите «Сохранить» .

Теперь вы можете перейти к следующему разделу, чтобы реализовать функцию App Flip в вашем приложении iOS или Android .

Реализуйте App Flip в своих нативных приложениях

Чтобы реализовать App Flip , вам необходимо изменить код авторизации пользователя в вашем приложении, чтобы он принимал глубокую ссылку от Google.

Протестируйте App Flip на своем устройстве

Теперь, когда вы создали интеграцию между облаками и настроили App Flip на консоли и в приложении, вы можете протестировать App Flip на мобильном устройстве. Для этого можно использовать приложение Google Home.

Чтобы протестировать App Flip из приложения Google Home , выполните следующие действия:

  1. Перейдите в консоль разработчика и выберите свой проект.
  2. Перейдите в раздел Облако-облако > Тест .
  3. Запустите процесс привязки аккаунта из приложения «Дом»:
    1. Откройте Google Home app (GHA) .
    2. Нажмите кнопку + .
    3. Нажмите «Настроить устройство» .
    4. Нажмите Что-то уже настроено?
    5. Выберите интеграцию Cloud-to-Cloud из списка поставщиков. В списке она будет иметь префикс «[test]». При выборе интеграции [test] из списка должно открыться ваше приложение.
    6. Убедитесь, что ваше приложение запущено, и начните тестирование процесса авторизации.