สมาร์ทโฟน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ช่วยให้ผู้ใช้ทำสิ่งต่างๆ ได้ทุกที่ทุกเวลา โดยใช้ความสามารถแบบหลายโมดัลเต็มรูปแบบที่ใช้ได้ในโทรศัพท์ ทั้งเสียงและภาพ
วิธีการต่างๆ
สำหรับอุปกรณ์เคลื่อนที่ที่มีหน้าจอ การดำเนินการของคุณต้องรองรับ 2 วิธีดังนี้
- การเรียกใช้เสียง
- การเรียกใช้แป้นพิมพ์
โปรดทราบว่าผู้ใช้ย้ายไปมาระหว่างวิธีการต่างๆ เหล่านี้ภายในการดำเนินการได้อย่างอิสระ อย่าลืมออกแบบคำตอบที่สมบูรณ์ในรูปแบบต่างๆ เหล่านี้โดยเฉพาะ เช่น เมื่อมีการเรียกใช้แป้นพิมพ์ จะไม่มีการเล่นเสียงใดๆ หากมีการระบุไว้ใน SSML หากการตอบสนองต้องอาศัยการได้ยินเสียงของผู้ใช้และอุปกรณ์ใช้รูปแบบแป้นพิมพ์ การดำเนินการของคุณจะต้องอธิบายประเภทเสียงที่เล่น
หากต้องการตรวจหาความพร้อมใช้งานของหน้าจอและรูปแบบการป้อนข้อมูลในสมาร์ทโฟน คุณใช้โค้ดต่อไปนี้ได้
- มีหน้าจอ:
if (conv.screen)
- ใช้รูปแบบเสียง:
if (conv.input.type === 'VOICE')
- ใช้รูปแบบแป้นพิมพ์:
if (conv.input.type === 'KEYBOARD')
เคล็ดลับและแนวทางปฏิบัติแนะนำ

ลองใช้การดำเนินการเหล่านี้
ลองดูตัวอย่างนี้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eBuild Actions that enable users to accomplish tasks on their mobile devices using voice and visual interactions.\u003c/p\u003e\n"],["\u003cp\u003eSupport both voice and keyboard invocation methods, tailoring responses appropriately for each modality.\u003c/p\u003e\n"],["\u003cp\u003eEnhance the user experience with rich responses, push notifications, and concise conversational flows.\u003c/p\u003e\n"],["\u003cp\u003eLeverage deep links to seamlessly integrate your Action with other platforms like websites and apps.\u003c/p\u003e\n"]]],["Actions on mobile devices should support both voice and keyboard input. Developers can detect screen availability and input modality using `conv.screen` and `conv.input.type` respectively. When using keyboard input, sounds should be described in text instead of played. Rich responses and theme customization enhance screen usage, while push notifications and deep links maintain user engagement. Prioritize quick task completion and intuitive conversational flows, considering the user is on the go.\n"],null,["# Smartphones\n\nHelp users get things done while they're on-the-go, using the full multimodal\ncapabilities available on phones, including both voice and visuals.\n\nModalities\n----------\n\nFor mobile devices which have screens, your Action needs to support two modalities:\n\n- Voice invocation\n- Keyboard invocation\n\nNote that users are free to move between these modalities within an Action. Make\nsure to design your rich responses specifically for each of these\nmodalities. For example, with keyboard invocation, no sounds are played if they\nare provided in [SSML](/assistant/conversational/df-asdk/ssml). If the response relies on the user hearing a sound and\nthe device is using keyboard modality, your Action needs to describe what kind\nsound of sound is played.\n\nTo detect the availability of a screen and the [input modality](/assistant/conversational/webhook/reference/rest/Shared.Types/InputType) on a smartphone, you can use the following code:\n\n- **Has screen** : `if (conv.screen)`\n- **Uses voice modality** : `if (conv.input.type === 'VOICE')`\n- **Uses keyboard modality** : `if (conv.input.type === 'KEYBOARD')`\n\nTips \\& best practices\n----------------------\n\n- Use [rich responses](/assistant/conversational/df-asdk/rich-responses) and [theme customization](/assistant/conversational/df-asdk/rich-responses#customizing_your_responses) to make the most out of the screen.\n- Consider using [push notifications](/assistant/engagement/notifications) to keep users engaged on mobile devices.\n- Remember that the user is on the go and try to help them achieve their task as quickly as possible. To learn how to craft natural and intuitive conversational flows, see the [conversation design guide](/assistant/conversational/df-asdk/design).\n- [Deep link directly to your Action](/assistant/engagement/assistant-links) from your website, mobile app, or social media for experiences better handled via voice.\n\nTry these Actions\n-----------------\n\n- [Starbucks](//assistant.google.com/services/a/uid/000000f2fb2c47e0?jsmode)\n- [SpotHero](//assistant.google.com/services/a/uid/00000031e1da95c6?jsmode)\n- [My Storytime](//assistant.google.com/services/a/id/6ebb0e742351c0dd?jsmode)\n\nTry this sample\n---------------\n\n- [Dialogflow conversation components sample](//github.com/actions-on-google/dialogflow-conversation-components-nodejs)"]]