สติ๊กเกอร์
นี่คือภาพรวมของคุณสมบัติที่สำคัญที่สุดที่ควรรวมไว้เมื่อจัดทำดัชนีสติกเกอร์หรือชุดสติกเกอร์เพื่อผสานรวมกับ Gboard ดู ตัวอย่างการจัดทำดัชนีแอป บน Github
คุณสมบัติ | คำอธิบาย | ตัวอย่าง |
---|---|---|
name | ชื่อหรือคำสำคัญที่ใช้ในการค้นหา — ไม่แสดง | "ชุดสติ๊กเกอร์สนูปปี้" |
url | URL ที่เชื่อมโยงไปยังสติ๊กเกอร์หรือชุดสติ๊กเกอร์ในแอพ | "http://sticker/pack/canonical/url/snoopy" |
image | สติ๊กเกอร์หรือสติ๊กเกอร์แพ็คกราฟิก เพื่อคุณภาพของภาพที่ดีที่สุด ให้ใช้ภาพสี่เหลี่ยมจัตุรัสขนาด 320 พิกเซลหรือ 500 พิกเซล | "http://link/to/the/image/bye" |
description | ป้ายการเข้าถึงสำหรับสติกเกอร์หรือชุดสติกเกอร์ของคุณ | "ชุดสติ๊กเกอร์สนูปปี้" |
ตัวอย่าง: ชุดสติ๊กเกอร์
// Build and index the sticker objects on first run after update or install // to minimize lag between sticker install and stickers surfacing in Gboard. FirebaseAppIndex.update(new Indexable.Builder("StickerPack") .setName("Snoopy Pack") .setImage("content://sticker/pack/canonical/image") // see: Support links to your app content section .setUrl("http://sticker/pack/canonical/url/snoopy") // Set the accessibility label for the sticker pack. .setDescription("A sticker pack of Snoopy") .put("hasSticker", new Indexable.Builder("Sticker") .setName("Hey") .setImage("http://link/to/the/image/hey") .setDescription("A Snoopy hey sticker.") .build(), new Indexable.Builder("Sticker") .setName("Bye") .setImage("http://link/to/the/image/bye") .setDescription("A Snoopy bye sticker.") .build()) .build());
ตัวอย่าง: สติกเกอร์ส่วนบุคคล
Indexable[] stickers = new Indexable[]{ new Indexable.Builder("Sticker") .setName("Hey") .setImage("http://www.snoopysticker.com?id=1234") // see: Support links to your app content section .setUrl("http://sticker/canonical/image/hey") // Set the accessibility label for the sticker. .setDescription("A sticker for hi") // Add search keywords. .put("keywords", "hey", "snoopy", "hi", "hello") .put("isPartOf", new Indexable.Builder("StickerPack") .setName("Snoopy Pack")) .build()) .build()), new Indexable.Builder("Sticker") .setName("Bye") .setImage("http://www.snoopysticker.com?id=4567") // see: Support links to your app content section .setUrl("http://sticker/canonical/image/bye") // Set the accessibility label for the sticker. .setDescription("A sticker for Bye") // Add search keywords. .put("keywords", "bye", "snoopy", "see ya", "good bye") .put("isPartOf", new Indexable.Builder("StickerPack") .setName("Snoopy Pack") .build()) .build())}; // Make sure we update stickers in batch FirebaseAppIndex.update(stickers);
ข้อความ
นี่คือภาพรวมของคุณสมบัติที่สำคัญที่สุดที่แอปควรระบุเมื่อจัดทำดัชนีข้อความ
คุณสมบัติ | คำอธิบาย | ตัวอย่าง |
---|---|---|
url | URL ที่เชื่อมโยงกับข้อความในแอป | "myapp://messages/42" |
name | บรรทัดเรื่องของข้อความหรือตัวข้อความโดยตรง หากไม่มีบรรทัดหัวเรื่องแยกต่างหาก | "Re: มื้อเที่ยง" |
text | ไม่จำเป็น. เนื้อความของข้อความ ถ้ามี สำหรับข้อความประเภทข้อความโต้ตอบแบบทันทีที่ไม่มีหัวเรื่องแยก ให้ใช้ "ชื่อ" (ดูด้านบน) | “คุณว่างกินข้าวเที่ยงหรือเปล่า?” |
dateReceived | เวลาที่ได้รับข้อความสำหรับข้อความขาเข้า | ใหม่ วันที่(2559, 6, 2, 23, 43, 00) |
dateSent | เวลาที่ส่งข้อความ สำหรับข้อความขาออก | ใหม่ วันที่(2559, 6, 2, 23, 43, 00) |
isPartOf.id | รหัสสำหรับการสนทนาหรือเธรดที่เป็นส่วนหนึ่งของข้อความ | "42" |
sender | ผู้ส่งข้อความ | |
sender.name | ชื่อของผู้ส่ง | "อลิซ" |
sender.url | ไม่จำเป็น. URL ที่ลิงก์ไปยังบุคคลในแอป | "http://example.net/profiles/alice" |
sender.image | ไม่จำเป็น. รูปภาพของผู้ส่ง อาจใช้ URL ของเว็บหรือ URI เนื้อหาก็ได้ | "http://example.net/alice.jpg" |
sender.email | ไม่จำเป็น. ที่อยู่อีเมลของผู้ส่ง | "alice@example.net" |
sender.telephone | ไม่จำเป็น. หมายเลขโทรศัพท์ของผู้ส่ง | "+16502530000" |
sender.isSelf | บ่งชี้ว่าผู้ใช้เป็นผู้ส่งหรือไม่ ค่าเริ่มต้นเป็นเท็จ | เท็จ |
recipient | ผู้รับข้อความหนึ่งหรือหลายคน | |
recipient.name | ชื่อของผู้รับ | "บ๊อบ" |
recipient.url | ไม่จำเป็น. URL ที่ลิงก์ไปยังบุคคลในแอป | "http://example.net/profiles/bob" |
recipient.image | ไม่จำเป็น. ภาพของผู้รับ อาจใช้ URL ของเว็บหรือ URI เนื้อหาก็ได้ | "http://example.net/bob.jpg" |
recipient.email | ไม่จำเป็น. ที่อยู่อีเมลของผู้ส่ง | "bob@example.net" |
recipient.telephone | ไม่จำเป็น. หมายเลขโทรศัพท์ของผู้ส่ง | "+16502530000" |
recipient.isSelf | บ่งชี้ว่าผู้ใช้เป็นผู้รับหรือไม่ ค่าเริ่มต้นเป็นเท็จ | จริง |
messageAttachment | ไม่จำเป็น. สิ่งที่แนบมากับข้อความหนึ่งหรือหลายรายการ | |
messageAttachment.name | ชื่อของสิ่งที่แนบมากับข้อความ | "สติ๊กเกอร์" |
messageAttachment.image | รูปภาพที่แสดงถึงสิ่งที่แนบมา อาจใช้ URL ของเว็บหรือ URI เนื้อหาก็ได้ | "http://example.net/stickers/23.png" |
ตัวอย่าง: ข้อความขาเข้า
Indexable message = Indexables.messageBuilder() .setUrl("myapp://messages/42") .setText("Are you free for lunch?") .setDateReceived(new Date(2016, 6, 2, 23, 44, 00)) .setIsPartOf(Indexables.conversationBuilder().setId("42") .setSender(Indexables.personBuilder() .setName("Alice") .setImage("http://example.net/alice.jpg") .setEmail("alice@example.net") .setTelephone("+16502530000")) .setRecipient(Indexables.personBuilder() .setName("Bob") .setImage("http://example.net/bob.jpg") .setEmail("bob@people.net") .setTelephone("+16502530000") .setIsSelf(true)) .build();
สำหรับข้อความอีเมล ให้ ใช้ Indexables.emailMessageBuilder()
แทน ไม่มีความแตกต่างในฟิลด์ที่รองรับ แต่ UI ผลลัพธ์จะแตกต่างออกไป (เช่น การเน้นบรรทัดหัวเรื่องของอีเมล)
บันทึก
นี่คือภาพรวมของคุณสมบัติที่สำคัญที่สุดที่แอปควรระบุเมื่อจัดทำดัชนีบันทึก
คุณสมบัติ | คำอธิบาย | ตัวอย่าง |
---|---|---|
url | URL ที่เชื่อมโยงกับบันทึกย่อในแอป | "myapp://notes/42" |
name | ชื่อเรื่องของบันทึกหรือข้อความของบันทึกโดยตรง หากไม่มีชื่อแยกต่างหาก | "รายการช้อปปิ้ง" |
text | ไม่จำเป็น. ข้อความในบันทึก ถ้ามี สำหรับบันทึกย่อที่ไม่มีชื่อแยกต่างหาก ให้ใช้ "ชื่อ" (ดูด้านบน) | "สเต็ก พาสต้า ไวน์" |
image | รูปภาพที่แสดงถึงบันทึกย่อ อาจใช้ URL ของเว็บหรือ URI เนื้อหาก็ได้ | "http://example.net/shopping.jpg" |
dateCreated | เวลาที่สร้างบันทึก | ใหม่ วันที่(2559, 6, 2, 23, 43, 00) |
author | ไม่จำเป็น. ผู้เขียนบันทึก | |
author.name | ชื่อผู้เขียนบันทึกย่อ | "บ๊อบ" |
ตัวอย่าง: หมายเหตุ
Indexable note = Indexables.noteDigitalDocumentBuilder() .setUrl("myapp://notes/42") .setName("Shopping list") .setText("steak, pasta, wine") .setImage("http://example.net/shopping.jpg") .setDateCreated(new Date(2016, 6, 2, 23, 43, 00)) .build();