ios - iBeacon emitted via [peripheralManager startAdvertising:] will trigger enter and soon followed by exit region on another device -
i'm trying grab ibeacon advertising code airlocate sample code empty app. looks like:
nsdictionary *peripheraldata = nil; region = [[clbeaconregion alloc] initwithproximityuuid:[[nsuuid alloc] initwithuuidstring:beaconuuid] major:beaconmajor minor:beaconminor identifier:beaconidentifier]; peripheraldata = [region peripheraldatawithmeasuredpower:nil];//[nsnumber numberwithint:power] // region's peripheral data contains corebluetooth-specific data need advertise. if(peripheraldata) { [peripheralmanager startadvertising:peripheraldata]; return yes; }
the empty app able emit ibeacon signal can monitored app on device. problem on app, locationmanager:didenterregion: delegate method followed locationmanager:didexitregion: quickly.
peripheral device: ipad mini 2 retina central device: iphone 5s
running airlocate app separately configure 1 device ibeacon emitter , device monitor can reproduce issue mentioned above.
some other findings:
- if leave receiver app is, report didenterregion automatically in few minutes, followed didexitregion quickly, still same problem.
- if move emitter app background mode pressing home button , enter same app again, receiver trigger round of 2 monitoring methods, still same problem.
my guess frequency of ibeacon advertising small (say, once few seconds) receiver may think region exited before receiving package again. may bug in ios.
does know it?
note cannot make ios transmit ibeacon in background. if lock screen comes up, exit notification on other device.
by default, ios device transmits advertisements @ rate of 30 hz, again, app must in foreground. have measured hardware ble sniffer. doubt transmit frequency issue.
Comments
Post a Comment