Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Nearby Messages API adalah API publikasi-langganan yang memungkinkan Anda meneruskan payload biner
kecil antara perangkat Android dan iOS yang terhubung ke internet. Perangkat
tidak harus berada di jaringan yang sama, tetapi harus terhubung ke
Internet.
Di Sekitar menggunakan Bluetooth Hemat Energi untuk menyampaikan kode penyambungan unik
di antara perangkat. Server memfasilitasi pertukaran pesan antar-perangkat yang
mendeteksi kode penyambungan yang sama. Saat mendeteksi kode penyambungan dari perangkat
di sekitar, perangkat akan mengirimkan kode penyambungan ke server Nearby Messages untuk validasi,
dan untuk memeriksa apakah ada pesan yang akan dikirim untuk kumpulan
langganan aplikasi saat ini.
Pesan Langsung tidak diautentikasi dan tidak memerlukan Akun Google.
Mekanisme persis untuk pertukaran data dapat bervariasi dari rilis ke rilis. Urutan
berikut menunjukkan peristiwa yang mengarah ke pertukaran pesan:
Aplikasi publikasi membuat permintaan untuk mengaitkan payload biner (pesan)
dengan kode penyambungan unik dalam waktu (token). Server membuat pengaitan sementara antara payload pesan dan token.
Perangkat publikasi menggunakan Bluetooth Hemat Energi untuk membuat token dapat dideteksi
oleh perangkat di sekitar. Perangkat publikasi juga menggunakan Bluetooth Hemat Energi untuk memindai
token dari perangkat lain.
Aplikasi yang berlangganan mengaitkan langganannya dengan token dan menggunakan Bluetooth
Hemat Energi untuk mengirim tokennya ke penayang, dan untuk mendeteksi token
penayang.
Saat salah satu sisi mendeteksi token sisi lain, token tersebut akan dilaporkan ke server.
Server memfasilitasi pertukaran pesan antara dua perangkat jika keduanya
dikaitkan dengan token yang sama, dan kunci API yang digunakan oleh aplikasi panggilan
dikaitkan dengan project yang sama di Konsol Google Developers.
Saat menggunakan Nearby SDK layanan Google Play, analisis penggunaan dikumpulkan untuk
meningkatkan pengalaman.
Metrik performa: Durasi publikasi dan langganan serta
jumlah pesan yang diterima dikumpulkan saat menggunakan Nearby SDK.
Informasi perangkat: Model perangkat, negara, versi build, dan
nama paket aplikasi dikumpulkan dan dikaitkan dengan metrik
performa untuk mengidentifikasi slice regional dan khusus perangkat.
Nearby Messages memublikasikan: Data yang dipublikasikan melalui Nearby Messages
disimpan oleh Google hingga pesan tidak lagi dipublikasikan. Data ini dibagikan
kepada pelanggan yang berada di dekat perangkat.
Pengguna akhir dapat mengizinkan atau menolak pengumpulan ini dengan membuka Setelan > Google >
Penggunaan & diagnostik.
[null,null,["Terakhir diperbarui pada 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."]]