實作 OAuth 2.0 後,您可以選擇設定以 OAuth 為基礎的 App Flip,讓 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
- You must have a Google authorization statement such as "Once linked, Google will have permission to control your devices."
- 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.
- 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.
- 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.
- 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:
Display Google's Privacy Policy. Include a link to Google's Privacy Policy on the consent screen.
Data to be shared. Use clear and concise language to tell the user what data of theirs Google requires and why.
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.
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.
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.

設定以 OAuth 為基礎的 App Flip
以下各節說明 OAuth 型應用程式切換的必要條件,以及如何在 Google Home 開發人員管理中心設定應用程式切換專案。
建立雲端對雲端整合,並設定 OAuth 2.0 伺服器
如要設定 App Flip,請先完成下列步驟:
- 設定 OAuth 2.0 伺服器。如要進一步瞭解如何設定 OAuth 伺服器,請參閱「實作 OAuth 2.0 伺服器」。
- 建立雲端對雲端整合。如要建立整合,請按照「建立雲端對雲端整合」一文的說明操作。
在開發人員控制台中設定應用程式切換功能
下節說明如何在開發人員控制台中設定應用程式切換功能。
- 填寫「OAuth 用戶端資訊」下方的所有欄位。 (如果系統不支援 App Flip,則會改用一般 OAuth)。
- 在「使用應用程式連結帳戶(選用)」下方,勾選「為 iOS 啟用」。
- 填寫「通用連結」欄位。如要進一步瞭解通用連結,請參閱「允許應用程式和網站連結至您的內容」。
- 如要視需要設定用戶端,請新增範圍,然後按一下「設定用戶端 (選用)」下方的「新增範圍」。
- 按一下 [儲存]。
現在可以繼續前往下一節,在 iOS 或 Android 應用程式中導入 App Flip。
在原生應用程式中導入 App Flip
如要實作 App Flip,您必須修改應用程式中的使用者授權碼,接受來自 Google 的深層連結。
在裝置上測試 App Flip
您已建立雲端對雲端整合,並在主控台和應用程式中設定應用程式切換功能,現在可以在行動裝置上測試這項功能。你可以使用 Google Home 應用程式測試應用程式切換功能。
如要透過 Google Home 應用程式測試 App Flip,請按照下列步驟操作:
- 前往 Developer Console,然後選取您的專案。
- 依序前往「雲端對雲端」>「測試」。
- 從 Google Home 應用程式觸發帳戶連結流程:
- 開啟 Google Home app (GHA)。
- 按一下「+」按鈕。
- 按一下「設定裝置」。
- 按一下「是否有已經設定好的裝置?」。
- 從供應商清單中選取雲端對雲端整合服務。清單中會以「[測試]」為前置字元。從清單中選取 [測試] 整合時,應用程式應會開啟。
- 確認應用程式已啟動,並開始測試授權流程。