-
Notifications
You must be signed in to change notification settings - Fork 444
Closed
Description
Hi
I'm trying to use GCM and iBeacon in one app. For the registration to GCM I use a service and start it as following in the onCreate of the activity:
startService(new Intent(this, MessageReceivingService.class));
After that I want to scan for iBeacons, with the BeaconManager.
beaconManager = new BeaconManager(this);
beaconManager.setRangingListener(new BeaconManager.RangingListener() {
@Override
public void onBeaconsDiscovered(Region region, List<Beacon> beacons) {
for (Beacon b : beacons) {
if (Utils.proximityFromAccuracy(Utils.computeAccuracy(b))
.equals(Utils.Proximity.NEAR)) {
Log.d(TAG, b.toString());
SharedPreferences prefs = getSharedPreferences(getString(R.string.preferences), Context.MODE_PRIVATE);
if(prefs != null && !prefs.getBoolean(getString(R.string.first_launch), true))
{
ApiService.notifyCustomer(b);
}
}
}
}
});
The problem is that the app doesn't start BLE scan for iBeacons. When I don't start the GCM Service, everything works fine. Is it a bug in the SDK or do I something wrong?
Metadata
Metadata
Assignees
Labels
No labels