Skip to content

Instantly share code, notes, and snippets.

@shu223
Last active February 12, 2018 18:23
Show Gist options
  • Save shu223/dcee295f0641dd61c7b0 to your computer and use it in GitHub Desktop.
Save shu223/dcee295f0641dd61c7b0 to your computer and use it in GitHub Desktop.
ビーコンを Core Bluetooth で検出するメリット

高速レンジング

ビーコン領域監視のレンジングは1秒間隔。それ以上速くできない。

実際これが結構遅い。 3mぐらいしか離れてないオブジェクト同士を移動する場合、didEnterとか待ってられないし、1秒待ってたら「遅い!」ってな感覚がある

Core Bluetooth を使えばアドバタイズのインターバルまで速くできる。100msecとか。

Core Location によるビーコン領域監視のメリットはバックグラウンドでの挙動なので、レンジングを高速に行いたい場合、フォアグラウンドでは Core Bluetooth を使うのがベストプラクティスなのでは?

ちなみにそもそもCoreLocationレンジングはフォアグラウンドでしか使えないらしい。 ってことはビーコン領域監視自体必要ない?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment