私は iPad アプリ (iPad Air、バックグラウンドではなくフォアグラウンドで実行されるアプリ) といくつかのビーコン (Estimote と Bluecat から) を試して、ビーコンを適切な順序でスキャンする必要がある屋内および屋外ゲームを開発しています。ビーコンは 5 x 5m 程度のエリア内に配置され、参加者はビーコンに近づかなければなりません (至近距離)。
ただし、ビーコンがCLProximityImmediate
範囲内にあることを検出するには、iPad が実際に物理的にビーコンに触れている場合でも、数秒 (これは問題ありません) から 30 ~ 60 秒程度 (長すぎます) かかる場合があります。私の実験によると、ビーコンは 1 秒に 1 回のように範囲指定されますが、即時の範囲を遅延で報告し、頻繁に報告しCLProximityUnknown
ます。
私の測距設定は次のとおりです(私は常に測距モードにあり、領域の出入りのオン/オフを切り替えません):
CLBeaconRegion *estimoteRegion = [[CLBeaconRegion alloc] initWithProximityUUID:estimoteUUID identifier:estimoteIdentifier];
CLBeaconRegion *bluecatRegion = [[CLBeaconRegion alloc] initWithProximityUUID:bluecatUUID identifier:bluecatIdentifier];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
[self.locationManager startRangingBeaconsInRegion:estimoteRegion];
[self.locationManager startRangingBeaconsInRegion:bluecatRegion];
また、レンジング イベント ハンドラは次のようになります。
- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region {
for(CLBeacon *beacon in beacons) {
if (beacon.proximity == CLProximityImmediate) {
// Handle it
break;
}
}
Core Location と Estimote SDK の両方を試しましたが、非常によく似た結果が得られます。
ビーコンの即時範囲センシングを高速化するための実用的なヒントはありますか? コア Bluetooth をさらに深くすることで、重大な改善が見込めるでしょうか?