I have used ESTBeaconConnect in a standalone fashion, e.g. in a beacon configuration UIView.
However, in order to keep the cloud up to date I want to connect to beacons which have not been connected in the last week or two.
Can I use one instance of ESTBeaconConnect to do multiple connections? I.e. when a qualified beacon is encountered I want to do a ‘fire-and-forget’ connection and am only interested in the delegate callback to flag that there was a successful connection. E.g. something like, but then with another function then initWithConnection which creates the instance:
if(_estBeaconConnection == nil) _estBeaconConnection = [[ESTBeaconConnection alloc] init];
[_estBeaconConnection initWithBeacon:beacon delegate:self startImmediately:NO];
[_estBeaconConnection startConnectionWithAttempts:1 connectionTimeout:15];
If beacons are close together then this might be called before the first connection is finished (especially with a slow connection).
Otherwise I would have to create an array with ESTBeaconConnection objects for this purpose to keep the references alive I guess, which is a little more, hopefully unneeded, complexion. It could be something like this:
ESTBeaconConnection* estBeaconConnection = [[ESTBeaconConnection alloc] initWithBeacon:beacon delegate:self startImmediately:NO];
[estBeaconConnection startConnectionWithAttempts:1 connectionTimeout:15];
[_estBeaconConnections addObject:estBeaconConnection];
And then:
- (void)beaconConnectionDidSucceed:(ESTBeaconConnection *)connection {
// do stuff
[_estBeaconConnections removeObject:connection];
}
Would this work safely?
(btw is timeout in seconds or milli-seconds?)