Can't detect when iBeacon bluetooth is turned off iOS - ios

I'm writing two simple apps. One is a beacon app whose signal you can start or stop with the touch of a button. The other is a receiver app that edits the text of a label when it detects the signal of a beacon.
I've tried using the didDetermineStateForRegion, didExitRegion, and didEnterRegion methods to detect when an app is running. These work fine for determining when the receiver moves in and out of proximity of the beacon, but it takes roughly 30 seconds to determine that I've turned the bluetooth on the beacon off. I've also tried setting my CLLocationManager's pausesLocationUpdatesAutomatically field to NO, but same thing. Ideally, it'd just immediately put "No" to my label; how do I do this?
MyView.h
#interface MyView : UIViewController
#property (weak, nonatomic) IBOutlet UILabel *statusLabel;
#property (strong, nonatomic) CLBeaconRegion *myBeaconRegion;
#property (strong, nonatomic) CLLocationManager *locationManager;
#end
MyView.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Initialize location manager and set ourselves as the delegate
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.locationManager.pausesLocationUpdatesAutomatically=NO;
// Create a NSUUID with the same UUID as the broadcasting beacon
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:#"ID"];
// Setup a new region with that UUID and same identifier as the broadcasting beacon
self.myBeaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid
identifier:#"identifier"];
// Tell location manager to start monitoring for the beacon region
[self.locationManager startMonitoringForRegion:self.myBeaconRegion];
}
- (void)locationManager:(CLLocationManager*)manager didEnterRegion:(CLRegion*)region
{
[self.locationManager startRangingBeaconsInRegion:self.myBeaconRegion];
self.statusLabel.text = #"Yes";
}
- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region {
if (state == CLRegionStateInside) {
self.statusLabel.text = #"Yes";
} else {
self.statusLabel.text = #"No";
}
}
-(void)locationManager:(CLLocationManager*)manager didExitRegion:(CLRegion*)region
{
[self.locationManager stopRangingBeaconsInRegion:self.myBeaconRegion];
self.statusLabel.text = #"No";
}

Region monitoring is pretty slow, you can use it for more general notification to let you know when you are near an iBeacon. I think for this case you would want to use didRangeBeacons, where your detection app will be notified of the beacon signal strength every second. You can use this signal strength to decide if you no longer see the beacon (CoreLocation tends to still "see" the beacon a few seconds after it disapears).
Just add the following method to your delegate:
-(void)locationManager:(CLLocationManager*)manager
didRangeBeacons:(NSArray*)beacons
inRegion:(CLBeaconRegion*)region
And start ranging for your region with:
[locationManager startRangingBeaconsInRegion:(CLBeaconRegion*)region];

Related

Cordova Application Monitoring evothings Estimote/iBeacon while the app is in killed state IOS

I've installed https://github.com/katzer/cordova-plugin-background-mode and https://github.com/katzer/cordova-plugin-local-notifications in my cordova application.
I am trying to monitor for beacons in the background when my app is closed and send a notification once a beacon has been detected and is in region.
Using the two plugins the app successfully works when the user has exited the app screen but the app is still on although does not work when the user has completely killed the process.
Can this be done solely using Javascript or would I have to modify the code in AppDelegate.m?
I've tried this using the following code:
#import "AppDelegate.h"
#import "MainViewController.h"
#import <CoreLocation/CoreLocation.h>
#interface AppDelegate ()
#property (nonatomic, strong) CLLocationManager *locationManager;
#property(nonatomic, assign) BOOL notifyEntryStateOnDisplay;
#end
#implementation AppDelegate
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.viewController = [[MainViewController alloc] init];
self.locationManager = [[CLLocationManager alloc] init];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region{
UILocalNotification *notification = [[UILocalNotification alloc] init];
NSLog(#"BLUETOOTH");
if(state == CLRegionStateInside)
{
notification.alertBody = [NSString stringWithFormat:#"You are inside region %#", region.identifier];
}
else if(state == CLRegionStateOutside)
{
notification.alertBody = [NSString stringWithFormat:#"You are outside region %#", region.identifier];
}
else
{
return;
}
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
#end
Although the application does not start. I've also changed settings in my xCode [General -> Capabilities] so that Background mode and push notifications is ON.
The app does what it needs to even if in the background and not killed although stops once the app is killed. I am trying to send a notification when the app is offline that a beacon is in range so that the user can turn the app on.
A few points:
You must set self.locationManager.delegate=self, and make your AppDelegate implement the CLLocationManagerDelegate protocol, specifically the didEnterRegion method that should be called when a beacon is discovered.
Beacon monitoring must be configured and initialized in the AppDelegate. You cannot rely the plugin to do this, because it won't necessarily leave beacon monitoring active when the app switches to the foreground.
When testing, set up a log message or breakpoint in the didEnterRegion method in your AppDelegate so you know if it gets called.

Getting coordinates CLLocationManager IOS

I'm trying to getting my current location exact according to my coordinates. I've implemented CLLocationManager in my viewController called myLocation.
My problem is, I'm getting not getting my co-ordinates for the first time, but when I again approach I got the coordinates. I'm unable to understand this problem that why this not appear for the first time.
I also tried to give a NSTimer to stoplocation but but still unable to get the result for the first time, every first time I getting a (null) value, and then getting the co-ordinates.
My Code:
#import <UIKit/UIKit.h>
#import <Corelocation/CoreLocation.h>
#interface myLocation : UITableViewController<CLLocationManagerDelegate>
#property (strong, nonatomic) CLLocationManager *locationManager;
#end
#interface myLocation () {
CLLocationManager* _locationManager;
NSString * _lat;
NSString * _lng;
}
#end
#implementation myLocation
- (void)viewDidLoad
{
[super viewDidLoad];
_locationManager = [[CLLocationManager alloc] init];
_locationManager.distanceFilter = kCLDistanceFilterNone;
_locationManager.delegate = self;
_locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
[_locationManager requestWhenInUseAuthorization];
[_locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations {
CLLocation *location = [locations lastObject];
[_locationManager stopUpdatingLocation];
_lat =[NSString stringWithFormat:#"%f",location.coordinate.latitude];
_lng =[NSString stringWithFormat:#"%f",location.coordinate.longitude];
}
- (void)viewWillAppear:(BOOL) animated
{
NSLOG(#"%#",_lat);
NSLOG(#"%#",_lng);
}
Your coordinates aren't appearing yet when you attempt to print them in viewWillAppear: because the CLLocationManager hasn't had enough time to retrieve the first location yet. Wait until didUpdateLocations: is first called before attempting to utilize the device coordinates because didUpdateLocations: is where you'll be receiving those coordinates. I recommend deleting your attempt to print the coordinates code from your viewWillAppear and simply print them in didUpdateLocations: instead.
In the comments, the OP stated he wants to "refresh" the location during viewWillAppear. I suggest stopping the updates when the view disappears and restarting the updates as soon as the view reappears:
- (void)viewWillAppear:(BOOL) animated
{
[_locationManager startUpdatingLocation];
}
- (void)viewWillDisappear:(BOOL) animated
{
[_locationManager stopUpdatingLocation];
}
It takes some time for location services to start up and call your delegate method - This almost certainly won't happen before viewWillAppear is called if you are only starting location services in viewDidLoad. Also, the first time your app executes it has to wait for the user to grant permission.
You can examine the location property of your CLLocationManager to get the most recent location. If it is nil then no location has been determined (yet).

Using multiples Beacons (poping a view on each different beacon)

I m a beginner in objective C.
My app work correctly with one beacon.
I'm using the "estimote SDK".
I have many problems, i want to use 2 or 3 beacons. I want to push a View for each of the beacons.
I don't understand how i can do it with multiple beacons.
I don't know if i have to use multiple beacon manager. (ESTBeaconManager* beaconManager)
I dont know how to pass differents regions to the didRangeBeacons:(NSArray *)beacons inRegion:(ESTBeaconRegion *)region
Can i use one beacon only for notification and the 2 others to pop 2 differents view when i m close of them. ( one different view for each beacon )
Thanks for your help.
Best Regards.
Code:
#import "ESTViewController.h"
#import "PresentViewController.h"
#import <ESTBeaconManager.h>
#import <AudioToolbox/AudioToolbox.h>
#interface ESTViewController () <ESTBeaconManagerDelegate>
#property (nonatomic, strong) ESTBeaconManager* beaconManager;
#property (nonatomic, strong) ESTBeaconManager* beaconManager2;
#property (nonatomic, strong) ESTBeaconManager* beaconManager3;
#property (nonatomic, strong) ESTBeacon* selectedBeacon;
#end
#implementation ESTViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// should i create one manager instance or more ?
self.beaconManager = [[ESTBeaconManager alloc] init];
self.beaconManager.delegate = self;
self.beaconManager.avoidUnknownStateBeacons = NO;
//self.beaconManager2 = [[ESTBeaconManager alloc] init];
//self.beaconManager2.delegate = self;
//self.beaconManager2.avoidUnknownStateBeacons = NO;
//self.beaconManager3 = [[ESTBeaconManager alloc] init];
//self.beaconManager3.delegate = self;
//self.beaconManager3.avoidUnknownStateBeacons = NO;
// My Differents regions
region = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:12800 minor:228 identifier:#"Icy Marshmellow"];
region2 = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:12800 minor:128 identifier:#"Mint Cocktail"];
region3 = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID
major:12800 minor:328 identifier:#"Blueberry Pie"];
// Should i do it for each region with one ESTBeaconManager or 3 ?
[self.beaconManager requestStateForRegion:region];
[self.beaconManager requestStateForRegion:region2];
[self.beaconManager requestStateForRegion:region3];
}
// NOTIFICATION METHOD :
-(void)beaconManager:(ESTBeaconManager *)manager
didEnterRegion:(ESTBeaconRegion *)region
{
// iPhone/iPad entered beacon zone
// present local notification
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = #"Hello blabla blabla";
notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
-(void)beaconManager:(ESTBeaconManager *)manager
didExitRegion:(ESTBeaconRegion *)region
{
// iPhone/iPad left beacon zone
// present local notification
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = #"bye bye";
notification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.beaconManager startRangingBeaconsInRegion:region];
[self.beaconManager startMonitoringForRegion:region];
//[self.beaconManager2 startRangingBeaconsInRegion:region2];
//[self.beaconManager2 startMonitoringForRegion:region2];
//[self.beaconManager3 startRangingBeaconsInRegion:region3];
//[self.beaconManager3 startMonitoringForRegion:region3];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.beaconManager stopRangingBeaconsInRegion:region];
[self.beaconManager stopMonitoringForRegion:region];
//[self.beaconManager2 stopRangingBeaconsInRegion:region2];
//[self.beaconManager2 stopMonitoringForRegion:region2];
//[self.beaconManager3 stopRangingBeaconsInRegion:region3];
//[self.beaconManager3 stopMonitoringForRegion:region3];
}
// My problem is here , i dont know how i can pass differents regions here
-(void)beaconManager:(ESTBeaconManager *)manager
didRangeBeacons:(NSArray *)beacons
inRegion:(ESTBeaconRegion *)region
{
if([beacons count] > 0)
{
if(!self.selectedBeacon)
{
// initialy pick closest beacon
self.selectedBeacon = [beacons objectAtIndex:0];
}
else
{
for (ESTBeacon* cBeacon in beacons)
{
// update beacon it same as selected initially
if([self.selectedBeacon.major unsignedShortValue] == [cBeacon.major unsignedShortValue] &&
[self.selectedBeacon.minor unsignedShortValue] == [cBeacon.minor unsignedShortValue])
{
self.selectedBeacon = cBeacon;
}
}
}
switch (self.selectedBeacon.proximity)
{
case CLProximityUnknown:
{
self.rangeStatusImageView.image = [UIImage imageNamed:#"logo_signal.jpg"];
self.descriptionStateLabel.text = #"Signal lost";
break;
}
case CLProximityImmediate:
{
[self performSegueWithIdentifier: #"presentSegue" sender: self];
break;
}
case CLProximityNear:
{
self.rangeStatusImageView.image = [UIImage imageNamed:#"logo_near_bleu.jpg"];
self.descriptionStateLabel.text = #"Come closer";
break;
}
case CLProximityFar:
{
self.rangeStatusImageView.image = [UIImage imageNamed:#"logo_far_clair.jpg"];
self.descriptionStateLabel.text = #"Welcome";
break;
}
default:
break;
}
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
#end
EDIT
Ok i worked on my code and now i do it with one region. my array of beacons have 3 beacons.
region = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID identifier:#"multibeacons"];
i dont use major or minor at the init.
in ViewDidAppears i do :
[self.beaconManager startRangingBeaconsInRegion:region];
The delegate like this :
-(void)beaconManager:(ESTBeaconManager *)manager
didRangeBeacons:(NSArray *)beacons
inRegion:(ESTBeaconRegion *)region
{
// I used a sort , sorting by distance
NSSortDescriptor *sortDescriptor;
sortDescriptor = [[NSSortDescriptor alloc] initWithKey:#"distance" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
// if breakpoint here 3 beacons in array
self.beaconsArray = [beacons sortedArrayUsingDescriptors:sortDescriptors];
if([self.beaconsArray count] > 0)
{
if(!self.selectedBeacon)
{
// initialy pick closest beacon
self.selectedBeacon = [beacons objectAtIndex:0];
currentBeaconMinor = self.selectedBeacon.minor;
}
else
{
for (ESTBeacon* cBeacon in self.beaconsArray)
{
// update beacon it same as selected initially
if([self.selectedBeacon.major unsignedShortValue] == [cBeacon.major unsignedShortValue] &&
[self.selectedBeacon.minor unsignedShortValue] == [cBeacon.minor unsignedShortValue])
{
self.selectedBeacon = cBeacon;
currentBeaconMinor = self.selectedBeacon.minor;
}
}
}
I sort by distance and i have a currentBeaconMinor Value. My array of beacon have 3 beacons inside if i put a breakpoint i can see 3.
In the Switch proximity , i have do like this :
switch (self.selectedBeacon.proximity)
{
case CLProximityImmediate:
{
if ([currentBeaconMinor floatValue] == 128)
{
NSLog(#"128 128 128");
//[self performSegueWithIdentifier: #"presentSegue1" sender: self];
}
else if ([currentBeaconMinor floatValue] == 228)
{
NSLog(#"228 228 228");
//[self performSegueWithIdentifier: #"presentSegue2" sender: self];
}
else if ([currentBeaconMinor floatValue] == 328)
{
NSLog(#"328 328 328");
//[self performSegueWithIdentifier: #"presentSegue3" sender: self];
}
break;
}
But that still dont work :((( I m getting mad. My app pick initialy the closest beacon. After that app always keep the same beacon and never change. I move the beacon near the device but nslog always send me the same minor number. Please can you give me some help ? I m sure i m doing something wrong.
Each beacon has 3 pieces of information - a UUID, a major number and a minor number. When you create a beacon region you must specify the UUID as a minimum. You can optionally specify a major and minor value. There is a limit to the number of beacon regions that iOS will scan for in the background (I believe it is 20), so generally it is best to be as broad as possible in your region registration and then determine when notified if you are interested in the beacon that is visible.
All Estimote beacons have the same UUID, so if you register a region with just the UUID your app will be notified whenever you are in range of any Estimote beacon. I can see that your three beacons are all using major 12800, so you could simply create a region that specified the UUID and the major and then you would be notified whenever a beacon with those values was visible - or you can do as you have done and register specific regions for each of your three beacons.
You only need a single EstBeaconManager instance to manage all regions.
Whenever you enter or exit a region your didEnterRegion and didExitRegion methods will be called. Also your didRangeBeacons method will be called if you are currently ranging beacons.
In these delegate methods you need to examine the major & minor (well, really just the minor, because in your case the major is always the same) values to determine which action you want to take. You can also examine the region identifier string to determine which beacon is visible.
Note that more than one beacon may be in range, so you may need to examine the proximities to determine which action you want to take.
Finally, although you define the three regions, you are not ranging/monitoring them all, so change your viewWillAppear to
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.beaconManager startRangingBeaconsInRegion:region];
[self.beaconManager startMonitoringForRegion:region];
[self.beaconManager startRangingBeaconsInRegion:region2];
[self.beaconManager startMonitoringForRegion:region2];
[self.beaconManager startRangingBeaconsInRegion:region3];
[self.beaconManager startMonitoringForRegion:region3];
}
I haven't used the Estimote SDK before. I just treat my Estimote beacons as vanilla iBeacons and use Apple's Location Manager framework.
It looks to me like you are very confused.
I looked at the Estimote SDK briefly, and it looked quite similar to Apple's location manager.
In the location manager, you create a beacon region, then you ask the location manager to start ranging for that beacon region (which tells you about estimated distance readings or you use startMonitoringForRegion to ask to be notified about enter/exit region events.
You can do both at the same time. Glancing at the Estimate APIs, it looks like they use the same approach.
You need to create a beacon region, then call startRangingBeaconsInRegion and/or startMonitoringForRegion to ask for range and/or enter/exit region notifications.
You then wait for your delegate method(s) to be called when a beacon enters/exits range, (startMonitoringForRegion) or changes distance (startRangingBeaconsInRegion)
Looking at the docs, it seems that calling requestStateForRegion will cause the Estimote beacon manager to call your locationManager:didDetermineState:forRegion: delegate method once and only once.
In your code, you haven't asked to monitor for regions or to range beacons, so all 3 regions will return a "not in range" state.
Don't call those requestStateForRegion. Call startMonitoringForRegion and/or startRangingBeaconsInRegion, and wait for the system to notify you when the beacon status changes.

didEnterRegion only fired on device wake up

I'm using local notifications triggered by iBeacons in my app. It works fine both in foreground and background as long as the iPhone is active, but doesn't trigger didEnterRegion after about 15 minutes of inactivity or reboot.
It then only fires again on wake up of the iPhone with the home button or sleep button, but I want didEnterRegion to "fire" when the iPhone is in a pocket for 15 minutes or more while entering the region as well.
Is this possible? If yes, how?
Background modes > Location updates is disabled
Some code:
.h
#property (strong, nonatomic) CLBeaconRegion *beaconRegion;
#property (strong, nonatomic) CLLocationManager *locationManager;
.m
- (void)start {
self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:uuid identifier:#"com.bla.bla"];
self.beaconRegion.notifyOnEntry = YES;
self.beaconRegion.notifyOnExit = YES;
self.beaconRegion.notifyEntryStateOnDisplay = YES;
self.locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
[self.locationManager startUpdatingLocation];
[self.locationManager startMonitoringForRegion:self.beaconRegion];
[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
[self.locationManager requestStateForRegion:self.beaconRegion];
}
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
[self.locationManager startRangingBeaconsInRegion:self.beaconRegion];
}
-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region {
[self.locationManager stopRangingBeaconsInRegion:self.beaconRegion];
}
- (void)locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error
{
NSLog(#"%#", [error localizedDescription]);
}
-(void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region {
if (state == CLRegionStateInside) {
[manager startRangingBeaconsInRegion:self.beaconRegion];
} else {
[manager stopRangingBeaconsInRegion:self.beaconRegion];
}
}
I'm not sure what is going on here, but the experience described in the question is not consistent with what I have seen testing on multiple devices. Posting the code that sets this up might help figure out some answers.
In several apps, I have been able to get background didEnterRegion callbacks, even after much more than 15 minutes of inactivity without pressing the shoulder button or the home button. And to do this, I have not had to set any background modes. (Apple will actually reject your app if you submit it to the store with background mode Location updates set unnecessarily.)
There is a bug in iOS 7.1 that cam halt iBeacon detections at some point after boot, so perhaps this is what is going on in this case. Details are here. Unfortunately, testing this hypothesis would require you to wake up the screen in order to turn bluetooth off and on to clear the condition, and that would wake up your screen and give you the region exit anyway. Perhaps you could try setting beaconregion.notifyEntryStateOnDisplay=NO, recreating this condition then try cycling bluetooth to see if you then get the notification. You can also use an off the shelf beacon scanning app like Locate for iBeacon to see if your device is able to range for iBeacons at all after it gets into this state, and only cycle to Bluetooth if you are unable to detect iBeacons.

Using Core Location on my iPod touch

i have been trying to implement the following code on my device:-
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#interface Whereami1ViewController : UIViewController<CLLocationManagerDelegate>
{
CLLocationManager *locationManager;
__weak IBOutlet UILabel *coordLabel;
}
#end
#implementation Whereami1ViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
locationManager.distanceFilter= 5.00;//5 meters
[locationManager startUpdatingLocation];
}
return self;
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{//location manager sends this message to self
NSLog(#"%#",NSStringFromSelector(_cmd));
NSLog(#"new location–– %#",[locations lastObject]);
NSLog(#"latitude= %f, longitude= %f",[[locations lastObject] coordinate].latitude, [[locations lastObject] coordinate].longitude);
CGSize coordData= {[[locations lastObject] coordinate].latitude, [[locations lastObject] coordinate].longitude};
coordLabel.text= NSStringFromCGSize(coordData);//setting the label's text
}
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
NSLog(#"%#",NSStringFromSelector(_cmd));
NSLog(#"location not found: %#", error);
}
#end
In the code i have set the distance filter as 5 meters. This means after 5 meters worth of movement the device goes through, it should be updating the label's text to a new coordinate,(latitude, longitude). But this is not happening in reality. I mean
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
should get called only when the device has moved more than 5 meters.In actuality, the device is stuck with the initial data (the label does not update in the view)..
What am i doing wrong.. Isn't this the right way??
The iPod touch uses WiFi networks for location service. So it may be impossible to get a good location or an update for 5 meter moves?! It ill behave quite different than an iPhone or iPda that also use GPS signals for location.

Resources