Siddiqui
Siddiqui

Reputation: 7840

Getting Current Location's Provider Detail in iPhone

I have implemented LocationManager and getting update of current location in didUpdateToLocation: every thing is working fine. Now I want to implement network triangulation, as far as I know that, The location services do this automatically. Just request the 'best accuracy' in your LocationManager and it will do network triangulation if GPS is not available or stable.

The problem is that I want to get the Location's Provider (GPS, Network), that which Location provider is providing the location. How can I get the Location's Provider Detail in my application.

Upvotes: 2

Views: 2100

Answers (2)

Steven Kramer
Steven Kramer

Reputation: 8503

See my answer here: Corelocation and assisted gps iPhone

That should help you tell the difference between GPS and triangulation.

Upvotes: 3

Deepesh
Deepesh

Reputation: 643

#import <UIKit/UIKit.h> 
#import <CoreLocation/CoreLocation.h>

@interface RootViewController : UIViewController<CLLocationManagerDelegate>

{ 

CLLocationManager   *locationManager;


} 
@property (nonatomic, retain) CLLocationManager *locationManager;

 @end




The implementation of our view controller is as follows:
#import "RootViewController.h"
 #import <objc/runtime.h>

@implementation RootViewController

@synthesize locationManager;

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation
{

NSLog(@"Latitude = %f", newLocation.coordinate.latitude);


 NSLog(@"Longitude = %f", newLocation.coordinate.longitude);

}

Upvotes: -1

Related Questions