I'm learning app development, both in IOS and Android, and after searching I'm not sure if I got my answer: I want to build an app that basicaly alerts the user when other user (same app) is nearby. The alert comes if they have, like, common interests (previously the users fill some kind of form). I found this piece of code here in Stack Overflow, but i'm not sure if it does this kind of job. Can anyone give me some hint?
- (void) activateProximitySensor {
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = YES;
if (device.proximityMonitoringEnabled == YES) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(proximityChanged:) name:@"UIDeviceProximityStateDidChangeNotification" object:device];
}
}
- (void) proximityChanged:(NSNotification *)notification {
UIDevice *device = [notification object];
NSLog(@"Detectat");
//DO WHATEVER I WANT
}