Nearby Messages API の Overview を翻訳してみました。
お気づきの点があればコメント頂ければと思います。
以下、関連する投稿へのリンクです。
■ Google Play services Nearby 公式 翻訳
■ Nearby Messages API (Overview) 公式 翻訳
■ Nearby Messages API for Android (Get Started) 公式 翻訳
■ Nearby Messages API for Android (Publish and Subscribe) 公式 翻訳
Overview
The Nearby Messages API is a publish-subscribe API that lets you pass small binary payloads between internet-connected Android and iOS devices. The devices don't have to be on the same network, but they do have to be connected to the Internet.
Nearby uses a combination of Bluetooth, Bluetooth Low Energy, Wi-Fi and near-ultrasonic audio to communicate a unique-in-time pairing code between devices. The server facilitates message exchange between devices that detect the same pairing code. When a device detects a pairing code from a nearby device, it sends the pairing code to the Nearby Messages server for validation, and to check whether there are any messages to deliver for the application’s current set of subscriptions.
Nearby Messages is unauthenticated and does not require a Google Account.
The exact mechanism for data exchange may vary from release to release. The following sequence shows the events leading to message exchange:
- A publishing app makes a request to associate a binary payload (the message) with a unique-in-time pairing code (token). The server makes a temporary association between the message payload and the token.
- The publishing device uses a combination of Bluetooth, Bluetooth Low Energy, Wi-Fi and an ultrasonic modem to make the token detectable by nearby devices. The publishing device also uses these technologies to scan for tokens from other devices.
- A subscribing app associates its subscription with a token and uses a mix of the above technologies to send its token to the publisher, and to detect the publisher's token.
- When either side detects the other's token, it reports it to the server.
- The server facilitates message exchange between two devices when both are associated with a common token, and the API keys used by the calling apps are associated with the same project in the Google Developers Console.
Nearby Messages APIはインターネットに接続したAndroidやiOSデバイス間で小さなバイナリのペイロードを伝播させるパブリッシュ-サブスクライブ APIです。 デバイスは同一ネットワーク上に存在する必要はありませんが、インターネットに接続している必要があります。
Nearbyはデバイス間で一意なペアリングコードを伝達するためBluetooth、BLE、wifi、超音波の組合せを使用します。 サーバーは同一のペアリングコードを検出したデバイス間のメッセージ交換を助けます。 デバイスは近くのデバイスからのペアリングコードを検出した時、検証のためNearby Messagesサーバーにペアリングコードを送信します。 そしてアプリケーションの現在のサブスクリプション セットへ配信されるメッセージがあるかどうかチェックします。
Nearby Messagesは認証されず、Googleアカウントを必要としません。
データ交換のための厳密な仕組みはリリースにより変わるかもしれません。 次の手順は、メッセージ交換に至るイベントを示しています。
-
パブリッシュするアプリはバイナリのペイロード(メッセージ)とペアリングコード(トークン)との関連付けを要求します。 サーバーは、メッセージペイロードとトークン間の一時的な関連付けを行います。
-
パブリッシュするデバイスは近くのデバイスがトークンを検出できるようにするためBluetooth、BLE、wifi、超音波の組合せを使用します。 また、パブリッシュするデバイスはそれらを他のデバイスからのトークンをスキャンするためにも使います。
-
サブスクライブするアプリはサブスクリプションとトークンを関連付けます。 そしてそのトークンをパブリッシャーに送信するためと、パブリッシャーのトークンを検出するために上記の技術を使用します。
-
いずれかの側が他方のトークンを検出すると、それはサーバーに通知されます。
-
サーバーは、両デバイスが共通のトークンで関連付けられており、呼出元アプリが使用しているAPI keyがGoogle Developers Consoleで同じプロジェクトに関連付けられているとき、2つのデバイス間のメッセージ交換を助けます。