我无法理解在 ibeaconSevice 库中使用 didDetermineStateForRegion(int state, Region region) 。
我有一个在后台模式下运行的服务,当我第一次看到一个信标时, didEnterRegion(Region region) 和 didDetermineStateForRegion(int state, Region region) 都被调用了。然后停止扫描。在下一次扫描中,即使我仍在同一区域,也不会执行回调。请问,你能帮忙吗?
iBeaconManager.setBackgroundMode(this, true);
iBeaconManager.setBackgroundMode(this, true);
iBeaconManager.setMonitorNotifier(new MonitorNotifier() {
@Override
public void didEnterRegion(Region region) {
Log.d(ConstantsDecoder.LOGTAG, "I just saw an iBeacon for the first time!");
}
@Override
public void didDetermineStateForRegion(int state, Region region) {
Log.d(ConstantsDecoder.LOGTAG, "I have just switched from seeing/not seeing iBeacons: "+state);
}