im trying build demo app using estimote beacons. want app open e specific viewcontroller when user near beacon. im using performseguewithidentifier when app starts opens first viewcontroller representing first beacon in range , doesnt open other ones when go near other beacons. somehow stops ranging other beacons. below code im using range beacons:
func beaconmanager(manager: anyobject, didrangebeacons beacons: [clbeacon], inregion region: clbeaconregion) { let knownbeacons = beacons.filter{ $0.proximity != clproximity.unknown} if (knownbeacons.count > 0) { let closestbeacon = knownbeacons [0] clbeacon if(closestbeacon.minor.integervalue==50557){ performseguewithidentifier("vc1", sender: nil) } else if(closestbeacon.minor.integervalue==37890){ performseguewithidentifier("vc2", sender: nil) } else if(closestbeacon.minor.integervalue==18976){ performseguewithidentifier("vc3", sender: nil) } else { self.view.backgroundcolor = uicolor.browncolor() }
i haven't used estimote's custom library, assume it's similar location manager's.
in core location manager, if app in background entered region notification when first enter new beacon region, , ranging information few seconds.
if you've set region unique uuid , major id no minor id, beacons uuid , major id considered part of same region , won't reliably ranging notifications beacons different minor ids become closest beacon.
if want handle multiple beacons in range @ same time , distinguish between them you'll need create separate beacon regions each beacon's uuid, major id and minor id.
i don't know if that's issue you're facing, be.
Comments
Post a Comment