API リファレンス

Discover (LAN)

ローカルネットワーク (LAN/Wi-Fi Aware) 上の他の PlainApp インスタンスを発見します。発見はペアリング前の最初のステップです——デバイスを発見したら、Pairing セクションでペアリングミューテーションを呼び出します。

型定義

bash
# Discovery uses UDP broadcast on the LAN and (optionally) Wi-Fi Aware.
# Discovered devices are not persisted; call isDiscovering to poll state.
# Use the NearbyViewModel events / WebSocket push channel to receive the
# live list of discovered devices.

操作

mutation

startDiscovery

ローカルネットワークで PlainApp peers のスキャンを開始します。即座に戻り、結果は WebSocket イベントチャネル経由でプッシュされ、Nearby UI に表示されます。

bash
mutation StartDiscovery {
  startDiscovery
}
mutation

stopDiscovery

進行中の発見スキャンを停止します。

bash
mutation StopDiscovery {
  stopDiscovery
}
query

isDiscovering

発見スキャンが現在実行中かどうか。

bash
query IsDiscovering {
  isDiscovering
}