קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Nearby Messages API הוא ממשק API מסוג פרסום-הרשמה שמאפשר להעביר עומסי נתונים בינאריים קטנים בין מכשירי Android ו-iOS שמחוברים לאינטרנט. המכשירים לא חייבים להיות מחוברים לאותה רשת, אבל הם חייבים להיות מחוברים לאינטרנט.
התכונה 'סמוך אליי' משתמשת ב-Bluetooth עם צריכת אנרגיה נמוכה כדי להעביר קוד התאמה ייחודי בין מכשירים. השרת מאפשר החלפת הודעות בין מכשירים שמזהים את אותו קוד התאמה. כשמכשיר מזהה קוד התאמה ממכשיר בקרבת מקום, הוא שולח את קוד ההתאמה לשרת של Nearby Messages לצורך אימות, וגם כדי לבדוק אם יש הודעות שצריך לשלוח לקבוצת המינויים הנוכחית של האפליקציה.
התכונה 'הודעות בסביבה' לא מאומתת ולא נדרש חשבון Google כדי להשתמש בה.
המנגנון המדויק של החלפת הנתונים עשוי להשתנות מגרסת build לגרסת build. ברצף הבא מוצגים האירועים שמובילים לחילופי ההודעות:
אפליקציית פרסום שולחת בקשה לשייך עומס נתונים בינארי (ההודעה) לקוד התאמה ייחודי (אסימון). השרת יוצר שיוך זמני בין עומס העבודה של ההודעה לאסימון.
במכשיר שמפרסם את התגים נעשה שימוש ב-Bluetooth עם צריכת אנרגיה נמוכה כדי לאפשר למכשירים בקרבת מקום לזהות את האסימון. מכשיר הפרסום משתמש גם ב-Bluetooth עם צריכת אנרגיה נמוכה כדי לסרוק אסימונים ממכשירים אחרים.
אפליקציה שמשתמשת במינוי משייכת את המינוי שלה לאסימון ומשתמשת ב-Bluetooth עם צריכת אנרגיה נמוכה כדי לשלוח את האסימון שלה לבעל האפליקציה ולזהות את האסימון של בעל האפליקציה.
כשאחד הצדדים מזהה את האסימון של הצד השני, הוא מדווח על כך לשרת.
השרת מאפשר החלפת הודעות בין שני מכשירים כששניהם משויכים לאסימון משותף, ומפתחות ה-API שבהם משתמשות האפליקציות הקוראות משויכים לאותו פרויקט ב-Google Developers Console.
כשמשתמשים ב-Nearby SDK של Google Play Services, נתוני ניתוח השימוש נאספים כדי לשפר את חוויית השימוש.
מדדי ביצועים: משך הפרסום וההרשמות ומספר ההודעות שהתקבלו נאספים כשמשתמשים ב-Nearby SDK.
פרטי המכשיר: דגם המכשיר, המדינה, גרסת ה-build ושם חבילת האפליקציה נאספים ומשויכים למדדי הביצועים כדי לזהות פלחים אזוריים וספציפיים למכשיר.
פרסום הודעות ב-Nearby Messages: Google שומרת את הנתונים שפורסמו דרך Nearby Messages עד שההודעה לא תפורסם יותר. הנתונים האלה משותפים עם מנויים שנמצאים בקרבת המכשיר.
משתמשי הקצה יכולים לאשר או לדחות את האיסוף הזה על ידי מעבר אל 'הגדרות' > Google > 'אופן השימוש בנתונים וניתוח הביצועים'.
[null,null,["עדכון אחרון: 2025-08-29 (שעון UTC)."],[[["\u003cp\u003eNearby Messages, a publish-subscribe API, enables the exchange of small data payloads between nearby Android and iOS devices over the internet using Bluetooth Low Energy.\u003c/p\u003e\n"],["\u003cp\u003eThis API, set to be deprecated in December 2023, is unauthenticated, doesn't require a Google account, and leverages a unique pairing code system for device discovery and message delivery.\u003c/p\u003e\n"],["\u003cp\u003eGoogle collects performance metrics, device information, and published message data to improve the service; however, users can control this data collection through their device settings.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers are encouraged to migrate to Nearby Connections for continued support and functionality.\u003c/p\u003e\n"]]],[],null,["# Overview\n\n| **Warning:** Nearby Messages is deprecated and will stop working as of December 2023. Please migrate to [Nearby Connections](//developers.google.com/nearby/connections/overview) for further support.\n\nThe Nearby Messages API is a publish-subscribe API that lets you pass small\nbinary payloads between internet-connected Android and iOS devices. The devices\ndon't have to be on the same network, but they do have to be connected to the\nInternet.\n\nNearby uses Bluetooth Low Energy to communicate a unique-in-time pairing code\nbetween devices. The server facilitates message exchange between devices that\ndetect the same pairing code. When a device detects a pairing code from a nearby\ndevice, it sends the pairing code to the Nearby Messages server for validation,\nand to check whether there are any messages to deliver for the application's\ncurrent set of subscriptions.\n\nNearby Messages is unauthenticated and does not require a Google Account.\n\nThe exact mechanism for data exchange may vary from release to release. The\nfollowing sequence shows the events leading to message exchange:\n\n1. A publishing app makes a request to associate a binary payload (the message)\n with a unique-in-time pairing code (token). The server makes a temporary\n association between the message payload and the token.\n\n2. The publishing device uses Bluetooth Low Energy to make the token detectable\n by nearby devices. The publishing device also uses Bluetooth Low Energy to scan\n for tokens from other devices.\n\n3. A subscribing app associates its subscription with a token and uses Bluetooth\n Low Energy to send its token to the publisher, and to detect the publisher's\n token.\n\n4. When either side detects the other's token, it reports it to the server.\n\n5. The server facilitates message exchange between two devices when both are\n associated with a common token, and the API keys used by the calling apps are\n associated with the same project in the [Google Developers Console](https://console.developers.google.com/).\n\nWhen using the Google Play services Nearby SDK, usage analytics are collected to\nimprove the experience.\n\n- **Performance metrics:** The duration of publishes and subscriptions and the number of messages received is collected when using the Nearby SDK.\n- **Device information:** Device model, country, build version and the application package name are collected and associated with the performance metrics to identify regional and device-specific slices.\n- **Nearby Messages publishes:** Data published through Nearby Messages is stored by Google until the message is no longer published. This data is shared with subscribers who are near the device.\n\nEnd users can allow or deny this collection by navigating to Settings \\\u003e Google \\\u003e\nUsage \\& diagnostics."]]