我正在使用Estimote开发estimote信标,我添加了APP_ID和APP_TOKEN,但仍然无法检测。
@Override
public void onCreate() {
super.onCreate();
beaconManager = new com.estimote.sdk.BeaconManager(getApplicationContext());
EstimoteSDK.initialize(getApplicationContext(), Constants.APP_ID, Constants.APP_TOKEN);
beaconManager.setMonitoringListener(new com.estimote.sdk.BeaconManager.MonitoringListener() {
@Override
public void onEnteredRegion(com.estimote.sdk.Region region, java.util.List<com.estimote.sdk.Beacon> list) {
showNotification("Welcome to the shop", "You are in");
}
@Override
public void onExitedRegion(com.estimote.sdk.Region region) {
}
});
}权限
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>请翻阅我的帖子,并建议我一些解决办法。
溶液
beaconManager.setNearableListener(new BeaconManager.NearableListener() {
@Override
public void onNearablesDiscovered(java.util.List<com.estimote.sdk.Nearable> nearables) {
}
});
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
scanId = beaconManager.startNearableDiscovery();
}
});发布于 2017-10-05 10:27:37
尝试使用需要监视的UUID和次要专业:
// this is were we left off:
beaconManager = new BeaconManager(getApplicationContext());
// add this below:
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
beaconManager.startMonitoring(new BeaconRegion(
"monitored region",
UUID.fromString("B9407F30-F5F8-466E-AFF9-25556B57FE6D"),
22504, 48827));
}
});https://stackoverflow.com/questions/39568864
复制相似问题