Search code examples
androidibeacon

How to find beacons as per specific major value?


I am making an app which finds Beacons. I have 3 beacons which is local brand with Major value 10. Is there any solution that my app finds only Beacons with Major value 10? I am facing problem that if other Beacons come in range then my Beacons are not detected.


Solution

  • You can filter beacon detections based on the Major value, but you must also supply ProximityUUID.

    Using iOS CoreLocation:

    CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] 
        initWithUUIDString:@"2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6"] 
        major: 10 
        identifier: @"region1"];
    [locationManager startMonitoringForRegion:region];  
    

    Using the Android Beacon Library:

    Region region = new Region("region1", 
        Identifier.parse("2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6"),
        Identifier.parse("10"), 
        null)
    beaconManager.startMonitoringBeaconsInRegion(region);