2025 年 4 月 1 日,Library API 中的部分範圍已遭到移除。
詳情請參閱這篇文章。
相片挑選:使用者看到的內容
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
這份指南可協助您瞭解使用者在選擇媒體項目時的體驗。
依照標準 Picker API 流程,選擇會在應用程式顯示 pickerUri
後,以及應用程式輪詢 mediaItemsSet
傳回 true 時開始。
如要在自己的裝置上查看任何步驟,請試用範例應用程式。
開始挑選工作階段
成功建立工作階段後,應用程式應向使用者顯示 pickerUri
。
- 以 QR code 和網址的形式顯示
pickerUri
。
- 請在
pickerUri
旁提供實用的說明文字。例如:「請掃描這段代碼,開啟 Google 相簿並選取相片/影片。」
- 如果是輸入功能受限的裝置 (例如資訊亭、平板電腦、智慧型電視),請查看硬體製造商針對文字大小和 QR code 寬度提供的建議。
搜尋及選取相片
使用者存取 pickerUri
時,系統會將他們帶往 Google 相簿應用程式中的相片選取頁面。
這個頁面會一律顯示使用者 Google 相簿媒體庫中的最新相片。相簿、收藏和其他常見的相片類別不會直接顯示。使用者可以使用各種條件搜尋相片,例如關鍵字、日期、地點和相簿名稱。
如果您的應用程式使用相簿、日期或其他常見的相片類別,請在使用者進入 Google 相簿應用程式後,提示他們進行搜尋,協助使用者。
舉例來說,如果您要求使用者分享特定相簿,可以在使用者連線至 Google 相簿的同一頁面中加入以下文字:「連線至 Google 相簿,然後搜尋要分享的相簿。」
搜尋後,使用者可從搜尋結果中選取一或多個項目。
「完成」畫面
使用者輕觸「完成」按鈕並完成選擇後,畫面上會顯示「完成」畫面。這會結束挑選工作階段,且目前的 pickerUri
將無法再運作。
如要讓使用者選擇更多相片,請建立新的挑選工作階段,並在應用程式中再次顯示 pickerUri
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[[["\u003cp\u003eThis guide explains the user experience within the Google Photos app when selecting media items using the Picker API.\u003c/p\u003e\n"],["\u003cp\u003eUsers initiate the process by accessing the \u003ccode\u003epickerUri\u003c/code\u003e displayed in your app, which opens a photo selection page within Google Photos.\u003c/p\u003e\n"],["\u003cp\u003eUsers can search and select photos from their Google Photos library using various criteria before confirming their choices.\u003c/p\u003e\n"],["\u003cp\u003eAfter selection, users are presented with a "Done" screen, and your app can re-display the \u003ccode\u003epickerUri\u003c/code\u003e to allow for further selections in a new session.\u003c/p\u003e\n"]]],["The core process involves displaying a `pickerUri` (QR code and URL) to users, prompting them to access it. This takes them to Google Photos for photo selection. Users can search using keywords, dates, or locations to find specific photos. Upon selection and pressing \"Done,\" the process ends. Apps can offer to display the `pickerUri` again to initiate a new picking session, to select more items. While the app is polling for the media selection the process has begun.\n"],null,["# Photo picking: what users see\n\nThis guide helps you understand your user's experience when picking media items.\n\nFollowing the [standard Picker API flow](/photos/picker/guides/get-started-picker#the_picker_api_flow),\npicking beings after your app displays the [`pickerUri`](/photos/picker/reference/rest/v1/sessions#PickingSession.FIELDS.picker_uri),\nand while your app is polling for [`mediaItemsSet`](/photos/picker/reference/rest/v1/sessions#PickingSession.FIELDS.media_items_set) to return true.\n\nTo view any of these steps on your own device, check out our [sample app](/photos/picker/samples).\n\nStart the picking session\n-------------------------\n\nAfter successfully creating a session your app should display the `pickerUri` to\nyour users.\n\n- Display the `pickerUri` as both a QR code and a URL.\n- Provide helpful text alongside the `pickerUri`. For example, \"Scan this code to open Google Photos and select your items.\".\n- For devices with limited input capabilities (e.g., kiosks, tablets, smart TVs), check your hardware manufacture's recommendations on text size and QR code width.\n\nSearch and select photos\n------------------------\n\nWhen a user accesses the `pickerUri`, they are taken to a photo selection page\nwithin the Google Photos app.\n\nThis page will always display the most recent photos from your user's Google\nPhotos library. Albums, favorites, and other common photos categories are not\nshow directly. Users can search for photos using various criteria,\nsuch as keywords, dates, locations, and album titles.\n\nIf your app utilizes albums, dates, or other common photos categories, help your\nusers by prompting them to search once they enter the Google Photos app.\n\nFor example, if your asking your users to share a specific album, you could\ninclude the following text on the same page your users connect to Google Photos:\n\"Connect to Google Photos, then search for the album you want to share.\"\n\nAfter searching, the user can select one or more items from the results.\n\nDone screen\n-----------\n\nOnce the user taps the \"Done\" button and completes picking, they will see\nthe \"Done\" screen. This ends the picking session and the current `pickerUri`\nwill no longer work.\n\nTo provide your users the option to select more photos, create a new picking\nsession and display the `pickerUri` again in your app."]]