تلنگر برنامه

پس از پیاده‌سازی OAuth 2.0، می‌توانید به صورت اختیاری App Flip مبتنی بر OAuth را پیکربندی کنید، که به کاربران Android شما اجازه می‌دهد سریع‌تر حساب‌های خود را در سیستم احراز هویت شما به حساب‌های گوگل خود پیوند دهند. بخش‌های زیر نحوه طراحی و پیاده‌سازی 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 Client را پر کنید. (اگر App Flip پشتیبانی نشود، OAuth معمولی به عنوان جایگزین استفاده می‌شود.)
  2. در قسمت «استفاده از برنامه شما برای پیوند حساب کاربری (اختیاری) ، گزینه «فعال کردن برای iOS» را علامت بزنید.
  3. فیلد پیوند جهانی را پر کنید. برای اطلاعات بیشتر در مورد پیوندهای جهانی، به بخش «اجازه دادن به برنامه‌ها و وب‌سایت‌ها برای پیوند دادن به محتوای شما» مراجعه کنید.
  4. اگر می‌خواهید کلاینت خود را به صورت اختیاری پیکربندی کنید، محدوده‌ها را اضافه کنید و در قسمت پیکربندی کلاینت (اختیاری)، روی افزودن محدوده کلیک کنید.
  5. روی ذخیره کلیک کنید.

اکنون می‌توانید برای پیاده‌سازی App Flip در اپلیکیشن iOS یا Android خود، به بخش بعدی بروید.

پیاده‌سازی App Flip در اپلیکیشن‌های نیتیو

برای پیاده‌سازی App Flip ، باید کد مجوز کاربر را در برنامه خود تغییر دهید تا یک لینک عمیق از گوگل را بپذیرد.

App Flip روی دستگاه خود آزمایش کنید

اکنون که یکپارچه‌سازی ابر به ابر را ایجاد کرده‌اید و App Flip را روی کنسول و در برنامه خود پیکربندی کرده‌اید، می‌توانید App Flip را روی دستگاه تلفن همراه خود آزمایش کنید. می‌توانید از برنامه Google Home برای آزمایش App Flip استفاده کنید.

برای آزمایش App Flip از برنامه Google Home ، این مراحل را دنبال کنید:

  1. به کنسول توسعه‌دهندگان بروید و پروژه خود را انتخاب کنید.
  2. به ابر به ابر > تست بروید.
  3. فعال کردن جریان لینک حساب از برنامه Home:
    1. Google Home app (GHA) را باز کنید.
    2. روی دکمه + کلیک کنید.
    3. روی راه‌اندازی دستگاه کلیک کنید.
    4. روی «آیا قبلاً چیزی راه‌اندازی شده است؟» کلیک کنید.
    5. ادغام ابر به ابر خود را از لیست ارائه دهندگان انتخاب کنید. در لیست با پیشوند "[test]" مشخص شده است. وقتی ادغام [test] خود را از لیست انتخاب می‌کنید، باید برنامه شما باز شود.
    6. تأیید کنید که برنامه شما راه‌اندازی شده است و آزمایش جریان مجوز خود را شروع کنید.