برنامه تلفن خود را برای Watch Face Push پیکربندی کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برای بازار متعارف، اپلیکیشن تلفن روش غالبی است که کاربر با آن در تعامل است.
یک صفحه ساعت تنظیم کنید
هنگامی که کاربر یک صفحه ساعت را در برنامه تلفن انتخاب می کند، دو بخش در جریان بعدی برای تنظیم صفحه ساعت وجود دارد:
نصب: صفحه ساعت را با استفاده از Watch Face Push که از طریق MessageClient آغاز شده است، نصب کنید. این مرحله ساده است، با استفاده از addWatchFace یا updateWatchFace ، که با استفاده از MessageClient از تلفن به ساعت راهاندازی میشود.
ممکن است هیچ اقدامی لازم نباشد. بازار ممکن است از قبل کنترل صفحه ساعت فعال را داشته باشد.
ممکن است نیازی به مداخله کاربر نباشد . این برنامه مجوزهای لازم را برای تنظیم صفحه ساعت فعال دارد و می تواند مستقیماً با استفاده از setWatchFaceAsActive() این کار را انجام دهد.
ممکن است راهنمایی لازم باشد، یا در مورد نحوه پذیرش درخواستهای مجوز، یا نحوه تنظیم دستی صفحه ساعت با استفاده از حرکت فشار طولانی یا از طریق یک برنامه همراه.
پاسخ نصب
برای تسهیل مرحله فعال سازی ، مرحله نصب باید اطلاعات زیر را از ساعت به گوشی برگرداند:
نتیجه تلاش برای نصب
نتیجه isWatchFaceActive() - برای تعیین اینکه آیا برنامه از قبل دارای صفحه ساعت فعال است یا خیر.
آیا setWatchFaceAsActive() قبلاً در گذشته فراخوانی شده است - برنامه Wear OS باید این اطلاعات را به صورت محلی ردیابی و حفظ کند. این تماس API فقط یک بار قابل استفاده است.
فعال سازی
پس از نصب، پاسخ ممکن است نشان دهد که برنامه از قبل دارای صفحه ساعت فعال است. اما اگر اینطور نباشد، برنامه ممکن است انتخاب کند که دکمهای را برای تنظیم صفحه ساعت به عنوان فعال نشان دهد.
سناریوی 1: تمام تلاش ها برای تنظیم صفحه ساعت فعال تمام شده است
اگر پاسخ نصب نشان میدهد که setWatchFaceAsActive() قبلاً در گذشته فراخوانی شده است، دکمه باید به صفحه آموزشی روی تلفن منتهی شود که به کاربر نشان میدهد چگونه صفحه ساعت را لمس و نگه دارد تا به صورت دستی آن را به صفحه مورد نظر خود تنظیم کند.
سناریو 2 - سعی کنید صفحه ساعت فعال را تنظیم کنید
تلفن باید به ساعت دستور دهد تا مجوز لازم SET_PUSHED_WATCH_FACE_AS_ACTIVE بررسی کند:
اگر کاربر قبلاً آن را اعطا کرده است، به فراخوانی setWatchFaceAsActive() ادامه دهید.
اگر کاربر قبلاً مجوز را رد کرده باشد، ساعت باید آن را به تلفن بازگرداند، جایی که میتوان یک صفحه آموزشی نشان داد که نیاز به مجوز و نحوه اعطای دستی آن را توضیح میدهد.
اگر قبلاً مجوز درخواست نشده است ، ساعت باید به تلفن دستور دهد که یک لحظه آموزشی را نشان دهد که کاربر را در مورد نحوه پذیرش مجوزها در ساعت راهنمایی می کند و ساعت باید درخواست مجوز را انجام دهد.
اگر کاربر مجوز را بدهد، ساعت باید setWatchFaceAsActive() فراخوانی کند.
در غیر این صورت، ساعت باید به تلفن دستور دهد که یک صفحه آموزشی نشان دهد که نیاز به مجوز و نحوه اعطای دستی آن را توضیح می دهد.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Configure your phone app for Watch Face Push\n\nFor the canonical marketplace, the phone app is the predominant way in which\nthe user interacts with the app.\n\nSet a watch face\n----------------\n\nWhen the user selects a watch face in the phone app, there are two parts to the\nsubsequent flow to set the watch face:\n\n1. **Installation:** Install the watch face using Watch Face Push, initiated through `MessageClient`. This step is straightforward, using either `addWatchFace` or `updateWatchFace`, triggered using `MessageClient` from the phone to the watch.\n2. **Activation:** [Set the installed watch face as active](/training/wearables/watch-face-push/wear-os-app#set-watch-face-as-active). This step has several possible paths, depending on the permission state:\n - There may be **no action needed**. The marketplace may already have control of the active watch face.\n - There may be **no user intervention needed** . The app has the necessary permissions to set the active watch face, and can do so directly using `setWatchFaceAsActive()`.\n - There may be **guidance needed**, either as to how to accept permission requests, or how to manually set the watch face using a long-press gesture or through a companion app.\n\nInstallation response\n---------------------\n\nTo facilitate the **Activation** phase, the **Installation** phase should return\nthe following information from the watch to the phone:\n\n- The outcome of the installation attempt\n- The result of `isWatchFaceActive()` - to determine whether the app already has the active watch face.\n- Whether `setWatchFaceAsActive()` has already been called in the past - the Wear OS app should track and persist this information locally. *This API\n call can only be used once.*\n\nActivation\n----------\n\nFollowing the installation, the response may indicate that the app already has\nthe active watch face. However if it does not, then the app may choose to show a\nbutton to **set watch face as active**.\n\n### Scenario 1: All attempts to set the active watch face are exhausted\n\nIf the response from installation indicated that `setWatchFaceAsActive()` had\nalready been called in the past, then the button should lead to an education\nscreen on the phone, showing the user how to touch \\& hold on the watch face to\nmanually set it to the one they want.\n\n### Scenario 2 - Try to set the active watch face\n\nThe phone should instruct the watch to check for the necessary\n`SET_PUSHED_WATCH_FACE_AS_ACTIVE` permission:\n\n- If the user has **already granted it**, proceed to calling setWatchFaceAsActive().\n- If the user has **previously denied the permission**, the watch should communicate this back to the phone, where an education screen can be shown explaining the need for the permission and how to manually grant it.\n- If the **permission has not been requested before**, the watch should\n instruct the phone to show an educational moment guiding the user on how to\n accept permissions on the watch, and the watch should proceed to request the\n permission.\n\n - If the user grants the permission, the watch should then call `setWatchFaceAsActive()`.\n - Otherwise the watch should instruct the phone to show an education screen explaining the need for the permission and how to manually grant it."]]