Ir para conteúdo
  • Cadastre-se
Entre para seguir isso  
sandokan

Problema com Location services em uma App

Posts Recomendados

Boa noite a todos!

Estou desenvolvendo uma App para iPhone que faz uso do serviço de localização (Location Services).

Mesmo com o Location Services habilitado, quando tento obter a localização atual do usuário, nada acontece, nenhum erro. O estranho também é que aquele "prompt" perguntando se o usuário permite a App utilizar o serviços de localização nunca é mostrado.

Vou deixar um trecho do código, que é o que está na documentação da Apple. Como podem observar o código, na verificação se o serviço está habilitado, retorna true, mas mesmo assim nada acontece.


- (void)getCurrentLocation{
if ([CLLocationManager locationServicesEnabled]) {
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = 500;
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
// codigo omitido para obter a latitude e longitude
}
[/CODE]

Alguém já passou por algo parecido?

*Obs: O teste está sendo feito diretamento no dispositivo, sem uso do simulador.

Abs.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boas,

Bom a primeira pergunta que faria você já respondeu ao Ferbass.

Seu código abaixo:

- (void)getCurrentLocation{

if ([CLLocationManager locationServicesEnabled]) {

locationManager = [[CLLocationManager alloc] init];

locationManager.delegate = self;

locationManager.desiredAccuracy = kCLLocationAccuracyBest;

locationManager.distanceFilter = 500;

[locationManager startUpdatingLocation];

}

- (void)locationManagerCLLocationManager *)manager

didUpdateToLocationCLLocation *)newLocation

fromLocationCLLocation *)oldLocation{

// codigo omitido para obter a latitude e longitude

}

Se tiver com todas as libs do xcode vá em: projeto depois busque na coluna info :

url types

clique sobre busque: localization native development..... e veja qual é o valor ao lado se yes ou no.

Em tempo busque essa lib e outra que falta neste link : https://github.com/libgit2/libgit2

[]´s

Editado por urielm

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boa noite a todos!

Estou desenvolvendo uma App para iPhone que faz uso do serviço de localização (Location Services).

Mesmo com o Location Services habilitado, quando tento obter a localização atual do usuário, nada acontece, nenhum erro. O estranho também é que aquele "prompt" perguntando se o usuário permite a App utilizar o serviços de localização nunca é mostrado.

Vou deixar um trecho do código, que é o que está na documentação da Apple. Como podem observar o código, na verificação se o serviço está habilitado, retorna true, mas mesmo assim nada acontece.


- (void)getCurrentLocation{
if ([CLLocationManager locationServicesEnabled]) {
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = 500;
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
// codigo omitido para obter a latitude e longitude
}
[/CODE]

Alguém já passou por algo parecido?

*Obs: O teste está sendo feito diretamento no dispositivo, sem uso do simulador.

Abs.

[b]Veja se ajuda em algo:[/b]

________________________________________________________________________

[b][size=3]Enabled locationManager:didChangeAuthorizationStatus: in app delegate[/size][/b]

<?xml version="1.0" encoding="UTF-8"?>

<Workspace

version = "1.0">

<FileRef

location = "self:LocationServices.xcodeproj">

</FileRef>

</Workspace>

________________________________________________________________________

[b]LocationServicesViewController.m[/b]

[color=#999999][b]//[/b][/color]

[color=#999999][b]// LocationServicesViewController.m[/b][/color]

[color=#999999][b]// LocationServices[/b][/color]

[color=#999999][b]//[/b][/color]

[color=#999999][b]// Created by Michael Harper on 9/1/11.[/b][/color]

[color=#999999][b]// Copyright 2011 Standalone Code LLC. All rights reserved.[/b][/color]

[color=#999999][b]//[/b][/color]

[color=#999999][b]#import "LocationServicesViewController.h"[/b][/color]

[b]@implementation[/b] [color=#445588][b]LocationServicesViewController[/b][/color]

[b]@synthesize[/b] latitudeLabel;

[b]@synthesize[/b] longitudeLabel;

[b]@synthesize[/b] headingLabel;

[b]@synthesize[/b] altitudeLabel;

[b]@synthesize[/b] hAccLabel;

[b]@synthesize[/b] vAccLabel;

[b]@synthesize[/b] lsLabel;

[b]@synthesize[/b] currentLocation;

[b]@synthesize[/b] currentHeading;

[b]@synthesize[/b] degreesFormatter;

[b]@synthesize[/b] distanceFormatter;

[b]@synthesize[/b] pitchLabel;

[b]@synthesize[/b] rollLabel;

[b]@synthesize[/b] yawLabel;

[color=#999999][b]#pragma mark - View lifecycle[/b][/color]

[b]-[/b] ([color=#445588][b]void[/b][/color])[color=#990000][b]viewDidLoad[/b][/color]

{

[super viewDidLoad];

[self addObserver:self forKeyPath:[color=#DD1144]@"currentLocation"[/color] options:NSKeyValueObservingOptionNew context:[color=#0086B3]nil[/color]];

[self addObserver:self forKeyPath:[color=#DD1144]@"currentHeading"[/color] options:NSKeyValueObservingOptionNew context:[color=#0086B3]nil[/color]];

self.degreesFormatter [b]=[/b] [[NSNumberFormatter alloc] init];

degreesFormatter.minimumIntegerDigits [b]=[/b] [color=#009999]1[/color];

degreesFormatter.maximumFractionDigits [b]=[/b] [color=#009999]6[/color];

self.distanceFormatter [b]=[/b] [[NSNumberFormatter alloc] init];

distanceFormatter.minimumIntegerDigits [b]=[/b] [color=#009999]1[/color];

distanceFormatter.maximumFractionDigits [b]=[/b] [color=#009999]1[/color];

}

[b]-[/b] ([color=#445588][b]void[/b][/color])[color=#990000][b]viewDidUnload[/b][/color]

{

[self removeObserver:self forKeyPath:[color=#DD1144]@"currentLocation"[/color]];

[self removeObserver:self forKeyPath:[color=#DD1144]@"currentHeading"[/color]];

[self setLatitudeLabel:[color=#0086B3]nil[/color]];

[self setLongitudeLabel:[color=#0086B3]nil[/color]];

[self setHeadingLabel:[color=#0086B3]nil[/color]];

[self setAltitudeLabel:[color=#0086B3]nil[/color]];

[self setHAccLabel:[color=#0086B3]nil[/color]];

[self setVAccLabel:[color=#0086B3]nil[/color]];

[self setLsLabel:[color=#0086B3]nil[/color]];

[self setPitchLabel:[color=#0086B3]nil[/color]];

[self setRollLabel:[color=#0086B3]nil[/color]];

[self setYawLabel:[color=#0086B3]nil[/color]];

[self setDegreesFormatter:[color=#0086B3]nil[/color]];

[self setDistanceFormatter:[color=#0086B3]nil[/color]];

[super viewDidUnload];

}

[b]-[/b] ([color=#445588][b]BOOL[/b][/color])[color=#990000][b]shouldAutorotateToInterfaceOrientation:[/b][/color](UIInterfaceOrientation)[color=#008080]interfaceOrientation[/color]

{

[b]return[/b] (interfaceOrientation [b]==[/b] UIInterfaceOrientationPortrait);

}

[color=#999999][b]#pragma mark CLLocationManagerDelegate methods[/b][/color]

[b]-[/b] ([color=#445588][b]void[/b][/color])[color=#990000][b]locationManager:[/b][/color](CLLocationManager [b]*[/b])[color=#008080]manager[/color] [color=#990000][b]didChangeAuthorizationStatus:[/b][/color](CLAuthorizationStatus)[color=#008080]status[/color]

{

NSString [b]*[/b]lsStatus [b]=[/b] [color=#DD1144]@""[/color];

[b]switch[/b] (status)

{

[b]case[/b] kCLAuthorizationStatusNotDetermined:

lsStatus [b]=[/b] [color=#DD1144]@"Undetermined"[/color];

[b]break[/b];

[b]case[/b] kCLAuthorizationStatusRestricted:

lsStatus [b]=[/b] [color=#DD1144]@"Restricted"[/color];

[b]break[/b];

[b]case[/b] kCLAuthorizationStatusDenied:

lsStatus [b]=[/b] [color=#DD1144]@"Denied"[/color];

[b]break[/b];

[b]case[/b] kCLAuthorizationStatusAuthorized:

lsStatus [b]=[/b] [color=#DD1144]@"Authorized"[/color];

[b]break[/b];

[b]default[/b][b]:[/b]

[b]break[/b];

}

lsLabel.text [b]=[/b] lsStatus;

}

[b]-[/b]([color=#445588][b]void[/b][/color]) [color=#990000][b]locationManager:[/b][/color](CLLocationManager [b]*[/b])[color=#008080]manager[/color] [color=#990000][b]didUpdateToLocation:[/b][/color](CLLocation [b]*[/b])[color=#008080]newLocation[/color] [color=#990000][b]fromLocation:[/b][/color](CLLocation [b]*[/b])[color=#008080]oldLocation[/color]

{

[b]if[/b] (newLocation.horizontalAccuracy [b]>[/b] [color=#009999]0[/color])

{

self.currentLocation [b]=[/b] newLocation;

}

}

[b]-[/b] ([color=#445588][b]void[/b][/color])[color=#990000][b]locationManager:[/b][/color](CLLocationManager [b]*[/b])[color=#008080]manager[/color] [color=#990000][b]didUpdateHeading:[/b][/color](CLHeading [b]*[/b])[color=#008080]newHeading[/color]

{

[b]if[/b] (newHeading.headingAccuracy [b]>[/b] [color=#009999]0[/color])

{

self.currentHeading [b]=[/b] newHeading;

}

}

[b]-[/b]([color=#445588][b]void[/b][/color]) [color=#990000][b]updateMotionInfo:[/b][/color](CMDeviceMotion [b]*[/b]) motionInfo

{

NSNumber [b]*[/b]number [b]=[/b] [NSNumber alloc];

pitchLabel.text [b]=[/b] [degreesFormatter stringFromNumber:[number initWithDouble:radiansToDegrees(motionInfo.attitude.pitch)]];

rollLabel.text [b]=[/b] [degreesFormatter stringFromNumber:[number initWithDouble:radiansToDegrees(motionInfo.attitude.roll)]];

yawLabel.text [b]=[/b] [degreesFormatter stringFromNumber:[number initWithDouble:radiansToDegrees(motionInfo.attitude.yaw)]];

}

[color=#999999][b]#pragma mark KVO[/b][/color]

[b]-[/b] ([color=#445588][b]void[/b][/color])observeValueForKeyPath:(NSString [b]*[/b])keyPath ofObject:([color=#445588][b]id[/b][/color])object change:(NSDictionary [b]*[/b])change context:([color=#445588][b]void[/b][/color] [b]*[/b])context

{

NSNumber [b]*[/b]number [b]=[/b] [NSNumber alloc];

[b]if[/b] ([keyPath isEqualToString:[color=#DD1144]@"currentLocation"[/color]])

{

CLLocation [b]*[/b]newLocation [b]=[/b] [change objectForKey:NSKeyValueChangeNewKey];

latitudeLabel.text [b]=[/b] [degreesFormatter stringFromNumber:[number initWithFloat:newLocation.coordinate.latitude]];

longitudeLabel.text [b]=[/b] [degreesFormatter stringFromNumber:[number initWithFloat:newLocation.coordinate.longitude]];

altitudeLabel.text [b]=[/b] [distanceFormatter stringFromNumber:[number initWithFloat:newLocation.altitude]];

hAccLabel.text [b]=[/b] [distanceFormatter stringFromNumber:[number initWithFloat:newLocation.horizontalAccuracy]];

vAccLabel.text [b]=[/b] [distanceFormatter stringFromNumber:[number initWithFloat:newLocation.verticalAccuracy]];

}

[b]else[/b] [b]if[/b] ([keyPath isEqualToString:[color=#DD1144]@"currentHeading"[/color]])

{

CLHeading [b]*[/b]newHeading [b]=[/b] [change objectForKey:NSKeyValueChangeNewKey];

headingLabel.text [b]=[/b] [degreesFormatter stringFromNumber:[number initWithFloat:newHeading.magneticHeading]];

}

}

[b]@end[/b]

________________________________________________________________________

[size=4]_________________________________________________________[/size]

[b]project.pbxproj[/b]

// !$*UTF8*$!

{

archiveVersion = 1;

classes = {

};

objectVersion = 46;

objects = {

/* Begin PBXBuildFile section */

B5E105CA141862000088AB8C /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B5E105C9141862000088AB8C /* Icon@2x.png */; };

B5E105CC141862450088AB8C /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B5E105CB141862450088AB8C /* Icon.png */; };

D87348FA141FF03C0060F374 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D87348F9141FF03C0060F374 /* CoreMotion.framework */; };

D8E1032D1410263600A403DB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E1032C1410263600A403DB /* UIKit.framework */; };

D8E1032F1410263600A403DB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E1032E1410263600A403DB /* Foundation.framework */; };

D8E103311410263600A403DB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E103301410263600A403DB /* CoreGraphics.framework */; };

D8E103371410263600A403DB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D8E103351410263600A403DB /* InfoPlist.strings */; };

D8E103391410263600A403DB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E103381410263600A403DB /* main.m */; };

D8E1033D1410263600A403DB /* LocationServicesAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E1033C1410263600A403DB /* LocationServicesAppDelegate.m */; };

D8E103401410263600A403DB /* LocationServicesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E1033F1410263600A403DB /* LocationServicesViewController.m */; };

D8E103431410263600A403DB /* LocationServicesViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8E103411410263600A403DB /* LocationServicesViewController_iPhone.xib */; };

D8E1034E1410263600A403DB /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E1034D1410263600A403DB /* SenTestingKit.framework */; };

D8E1034F1410263600A403DB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E1032C1410263600A403DB /* UIKit.framework */; };

D8E103501410263600A403DB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E1032E1410263600A403DB /* Foundation.framework */; };

D8E103511410263600A403DB /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E103301410263600A403DB /* CoreGraphics.framework */; };

D8E103591410263600A403DB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D8E103571410263600A403DB /* InfoPlist.strings */; };

D8E1035C1410263600A403DB /* LocationServicesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E1035B1410263600A403DB /* LocationServicesTests.m */; };

D8E10366141026E900A403DB /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E10365141026E900A403DB /* CoreLocation.framework */; };

/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */

D8E103521410263600A403DB /* PBXContainerItemProxy */ = {

isa = PBXContainerItemProxy;

containerPortal = D8E1031F1410263500A403DB /* Project object */;

proxyType = 1;

remoteGlobalIDString = D8E103271410263600A403DB;

remoteInfo = LocationServices;

};

/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */

B5E105C9141862000088AB8C /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };

B5E105CB141862450088AB8C /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };

B5E105CD141865350088AB8C /* AppIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AppIcon.png; sourceTree = "<group>"; };

D87348F9141FF03C0060F374 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };

D8E103281410263600A403DB /* Locinator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Locinator.app; sourceTree = BUILT_PRODUCTS_DIR; };

D8E1032C1410263600A403DB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };

D8E1032E1410263600A403DB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };

D8E103301410263600A403DB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };

D8E103341410263600A403DB /* LocationServices-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LocationServices-Info.plist"; sourceTree = "<group>"; };

D8E103361410263600A403DB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };

D8E103381410263600A403DB /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };

D8E1033A1410263600A403DB /* LocationServices-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LocationServices-Prefix.pch"; sourceTree = "<group>"; };

D8E1033B1410263600A403DB /* LocationServicesAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocationServicesAppDelegate.h; sourceTree = "<group>"; };

D8E1033C1410263600A403DB /* LocationServicesAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocationServicesAppDelegate.m; sourceTree = "<group>"; };

D8E1033E1410263600A403DB /* LocationServicesViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocationServicesViewController.h; sourceTree = "<group>"; };

D8E1033F1410263600A403DB /* LocationServicesViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocationServicesViewController.m; sourceTree = "<group>"; };

D8E103421410263600A403DB /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/LocationServicesViewController_iPhone.xib; sourceTree = "<group>"; };

D8E1034C1410263600A403DB /* LocationServicesTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LocationServicesTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };

D8E1034D1410263600A403DB /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };

D8E103561410263600A403DB /* LocationServicesTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LocationServicesTests-Info.plist"; sourceTree = "<group>"; };

D8E103581410263600A403DB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };

D8E1035A1410263600A403DB /* LocationServicesTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocationServicesTests.h; sourceTree = "<group>"; };

D8E1035B1410263600A403DB /* LocationServicesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocationServicesTests.m; sourceTree = "<group>"; };

D8E10365141026E900A403DB /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };

/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */

D8E103251410263600A403DB /* Frameworks */ = {

isa = PBXFrameworksBuildPhase;

buildActionMask = 2147483647;

files = (

D87348FA141FF03C0060F374 /* CoreMotion.framework in Frameworks */,

D8E10366141026E900A403DB /* CoreLocation.framework in Frameworks */,

D8E1032D1410263600A403DB /* UIKit.framework in Frameworks */,

D8E1032F1410263600A403DB /* Foundation.framework in Frameworks */,

D8E103311410263600A403DB /* CoreGraphics.framework in Frameworks */,

);

runOnlyForDeploymentPostprocessing = 0;

};

D8E103481410263600A403DB /* Frameworks */ = {

isa = PBXFrameworksBuildPhase;

buildActionMask = 2147483647;

files = (

D8E1034E1410263600A403DB /* SenTestingKit.framework in Frameworks */,

D8E1034F1410263600A403DB /* UIKit.framework in Frameworks */,

D8E103501410263600A403DB /* Foundation.framework in Frameworks */,

D8E103511410263600A403DB /* CoreGraphics.framework in Frameworks */,

);

runOnlyForDeploymentPostprocessing = 0;

};

/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */

B5E105CF141866270088AB8C /* Resources */ = {

isa = PBXGroup;

children = (

B5E105CD141865350088AB8C /* AppIcon.png */,

B5E105CB141862450088AB8C /* Icon.png */,

B5E105C9141862000088AB8C /* Icon@2x.png */,

);

name = Resources;

sourceTree = "<group>";

};

D8E1031D1410263500A403DB = {

isa = PBXGroup;

children = (

D87348F9141FF03C0060F374 /* CoreMotion.framework */,

B5E105CF141866270088AB8C /* Resources */,

D8E103321410263600A403DB /* LocationServices */,

D8E103541410263600A403DB /* LocationServicesTests */,

D8E1032B1410263600A403DB /* Frameworks */,

D8E103291410263600A403DB /* Products */,

);

sourceTree = "<group>";

};

D8E103291410263600A403DB /* Products */ = {

isa = PBXGroup;

children = (

D8E103281410263600A403DB /* Locinator.app */,

D8E1034C1410263600A403DB /* LocationServicesTests.octest */,

);

name = Products;

sourceTree = "<group>";

};

D8E1032B1410263600A403DB /* Frameworks */ = {

isa = PBXGroup;

children = (

D8E10365141026E900A403DB /* CoreLocation.framework */,

D8E1032C1410263600A403DB /* UIKit.framework */,

D8E1032E1410263600A403DB /* Foundation.framework */,

D8E103301410263600A403DB /* CoreGraphics.framework */,

D8E1034D1410263600A403DB /* SenTestingKit.framework */,

);

name = Frameworks;

sourceTree = "<group>";

};

D8E103321410263600A403DB /* LocationServices */ = {

isa = PBXGroup;

children = (

D8E1033B1410263600A403DB /* LocationServicesAppDelegate.h */,

D8E1033C1410263600A403DB /* LocationServicesAppDelegate.m */,

D8E1033E1410263600A403DB /* LocationServicesViewController.h */,

D8E1033F1410263600A403DB /* LocationServicesViewController.m */,

D8E103411410263600A403DB /* LocationServicesViewController_iPhone.xib */,

D8E103331410263600A403DB /* Supporting Files */,

);

path = LocationServices;

sourceTree = "<group>";

};

D8E103331410263600A403DB /* Supporting Files */ = {

isa = PBXGroup;

children = (

D8E103341410263600A403DB /* LocationServices-Info.plist */,

D8E103351410263600A403DB /* InfoPlist.strings */,

D8E103381410263600A403DB /* main.m */,

D8E1033A1410263600A403DB /* LocationServices-Prefix.pch */,

);

name = "Supporting Files";

sourceTree = "<group>";

};

D8E103541410263600A403DB /* LocationServicesTests */ = {

isa = PBXGroup;

children = (

D8E1035A1410263600A403DB /* LocationServicesTests.h */,

D8E1035B1410263600A403DB /* LocationServicesTests.m */,

D8E103551410263600A403DB /* Supporting Files */,

);

path = LocationServicesTests;

sourceTree = "<group>";

};

D8E103551410263600A403DB /* Supporting Files */ = {

isa = PBXGroup;

children = (

D8E103561410263600A403DB /* LocationServicesTests-Info.plist */,

D8E103571410263600A403DB /* InfoPlist.strings */,

);

name = "Supporting Files";

sourceTree = "<group>";

};

/* End PBXGroup section */

/* Begin PBXNativeTarget section */

D8E103271410263600A403DB /* Locinator */ = {

isa = PBXNativeTarget;

buildConfigurationList = D8E1035F1410263600A403DB /* Build configuration list for PBXNativeTarget "Locinator" */;

buildPhases = (

D8E103241410263600A403DB /* Sources */,

D8E103251410263600A403DB /* Frameworks */,

D8E103261410263600A403DB /* Resources */,

);

buildRules = (

);

dependencies = (

);

name = Locinator;

productName = LocationServices;

productReference = D8E103281410263600A403DB /* Locinator.app */;

productType = "com.apple.product-type.application";

};

D8E1034B1410263600A403DB /* LocationServicesTests */ = {

isa = PBXNativeTarget;

buildConfigurationList = D8E103621410263600A403DB /* Build configuration list for PBXNativeTarget "LocationServicesTests" */;

buildPhases = (

D8E103471410263600A403DB /* Sources */,

D8E103481410263600A403DB /* Frameworks */,

D8E103491410263600A403DB /* Resources */,

D8E1034A1410263600A403DB /* ShellScript */,

);

buildRules = (

);

dependencies = (

D8E103531410263600A403DB /* PBXTargetDependency */,

);

name = LocationServicesTests;

productName = LocationServicesTests;

productReference = D8E1034C1410263600A403DB /* LocationServicesTests.octest */;

productType = "com.apple.product-type.bundle";

};

/* End PBXNativeTarget section */

/* Begin PBXProject section */

D8E1031F1410263500A403DB /* Project object */ = {

isa = PBXProject;

attributes = {

LastUpgradeCheck = 0420;

ORGANIZATIONNAME = "Standalone Code LLC";

};

buildConfigurationList = D8E103221410263500A403DB /* Build configuration list for PBXProject "LocationServices" */;

compatibilityVersion = "Xcode 3.2";

developmentRegion = English;

hasScannedForEncodings = 0;

knownRegions = (

en,

);

mainGroup = D8E1031D1410263500A403DB;

productRefGroup = D8E103291410263600A403DB /* Products */;

projectDirPath = "";

projectRoot = "";

targets = (

D8E103271410263600A403DB /* Locinator */,

D8E1034B1410263600A403DB /* LocationServicesTests */,

);

};

/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */

D8E103261410263600A403DB /* Resources */ = {

isa = PBXResourcesBuildPhase;

buildActionMask = 2147483647;

files = (

D8E103371410263600A403DB /* InfoPlist.strings in Resources */,

D8E103431410263600A403DB /* LocationServicesViewController_iPhone.xib in Resources */,

B5E105CA141862000088AB8C /* Icon@2x.png in Resources */,

B5E105CC141862450088AB8C /* Icon.png in Resources */,

);

runOnlyForDeploymentPostprocessing = 0;

};

D8E103491410263600A403DB /* Resources */ = {

isa = PBXResourcesBuildPhase;

buildActionMask = 2147483647;

files = (

D8E103591410263600A403DB /* InfoPlist.strings in Resources */,

);

runOnlyForDeploymentPostprocessing = 0;

};

/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */

D8E1034A1410263600A403DB /* ShellScript */ = {

isa = PBXShellScriptBuildPhase;

buildActionMask = 2147483647;

files = (

);

inputPaths = (

);

outputPaths = (

);

runOnlyForDeploymentPostprocessing = 0;

shellPath = /bin/sh;

shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";

};

/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */

D8E103241410263600A403DB /* Sources */ = {

isa = PBXSourcesBuildPhase;

buildActionMask = 2147483647;

files = (

D8E103391410263600A403DB /* main.m in Sources */,

D8E1033D1410263600A403DB /* LocationServicesAppDelegate.m in Sources */,

D8E103401410263600A403DB /* LocationServicesViewController.m in Sources */,

);

runOnlyForDeploymentPostprocessing = 0;

};

D8E103471410263600A403DB /* Sources */ = {

isa = PBXSourcesBuildPhase;

buildActionMask = 2147483647;

files = (

D8E1035C1410263600A403DB /* LocationServicesTests.m in Sources */,

);

runOnlyForDeploymentPostprocessing = 0;

};

/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */

D8E103531410263600A403DB /* PBXTargetDependency */ = {

isa = PBXTargetDependency;

target = D8E103271410263600A403DB /* Locinator */;

targetProxy = D8E103521410263600A403DB /* PBXContainerItemProxy */;

};

/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */

D8E103351410263600A403DB /* InfoPlist.strings */ = {

isa = PBXVariantGroup;

children = (

D8E103361410263600A403DB /* en */,

);

name = InfoPlist.strings;

sourceTree = "<group>";

};

D8E103411410263600A403DB /* LocationServicesViewController_iPhone.xib */ = {

isa = PBXVariantGroup;

children = (

D8E103421410263600A403DB /* en */,

);

name = LocationServicesViewController_iPhone.xib;

sourceTree = "<group>";

};

D8E103571410263600A403DB /* InfoPlist.strings */ = {

isa = PBXVariantGroup;

children = (

D8E103581410263600A403DB /* en */,

);

name = InfoPlist.strings;

sourceTree = "<group>";

};

/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */

D8E1035D1410263600A403DB /* Debug */ = {

isa = XCBuildConfiguration;

buildSettings = {

ALWAYS_SEARCH_USER_PATHS = NO;

ARCHS = "$(ARCHS_STANDARD_32_BIT)";

CLANG_ENABLE_OBJC_ARC = YES;

"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";

COPY_PHASE_STRIP = NO;

GCC_C_LANGUAGE_STANDARD = gnu99;

GCC_DYNAMIC_NO_PIC = NO;

GCC_OPTIMIZATION_LEVEL = 0;

GCC_PREPROCESSOR_DEFINITIONS = (

"DEBUG=1",

"$(inherited)",

);

GCC_SYMBOLS_PRIVATE_EXTERN = NO;

GCC_VERSION = com.apple.compilers.llvm.clang.1_0;

GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;

GCC_WARN_ABOUT_RETURN_TYPE = YES;

GCC_WARN_UNUSED_VARIABLE = YES;

IPHONEOS_DEPLOYMENT_TARGET = 5.0;

SDKROOT = iphoneos;

TARGETED_DEVICE_FAMILY = 1;

};

name = Debug;

};

D8E1035E1410263600A403DB /* Release */ = {

isa = XCBuildConfiguration;

buildSettings = {

ALWAYS_SEARCH_USER_PATHS = NO;

ARCHS = "$(ARCHS_STANDARD_32_BIT)";

CLANG_ENABLE_OBJC_ARC = YES;

"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";

COPY_PHASE_STRIP = YES;

GCC_C_LANGUAGE_STANDARD = gnu99;

GCC_VERSION = com.apple.compilers.llvm.clang.1_0;

GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;

GCC_WARN_ABOUT_RETURN_TYPE = YES;

GCC_WARN_UNUSED_VARIABLE = YES;

IPHONEOS_DEPLOYMENT_TARGET = 5.0;

OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";

SDKROOT = iphoneos;

TARGETED_DEVICE_FAMILY = 1;

VALIDATE_PRODUCT = YES;

};

name = Release;

};

D8E103601410263600A403DB /* Debug */ = {

isa = XCBuildConfiguration;

buildSettings = {

GCC_PRECOMPILE_PREFIX_HEADER = YES;

GCC_PREFIX_HEADER = "LocationServices/LocationServices-Prefix.pch";

INFOPLIST_FILE = "LocationServices/LocationServices-Info.plist";

IPHONEOS_DEPLOYMENT_TARGET = 4.2;

PRODUCT_NAME = "$(TARGET_NAME)";

WRAPPER_EXTENSION = app;

};

name = Debug;

};

D8E103611410263600A403DB /* Release */ = {

isa = XCBuildConfiguration;

buildSettings = {

"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";

GCC_PRECOMPILE_PREFIX_HEADER = YES;

GCC_PREFIX_HEADER = "LocationServices/LocationServices-Prefix.pch";

INFOPLIST_FILE = "LocationServices/LocationServices-Info.plist";

IPHONEOS_DEPLOYMENT_TARGET = 4.2;

PRODUCT_NAME = "$(TARGET_NAME)";

"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";

WRAPPER_EXTENSION = app;

};

name = Release;

};

D8E103631410263600A403DB /* Debug */ = {

isa = XCBuildConfiguration;

buildSettings = {

BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LocationServices.app/LocationServices";

FRAMEWORK_SEARCH_PATHS = (

"$(SDKROOT)/Developer/Library/Frameworks",

"$(DEVELOPER_LIBRARY_DIR)/Frameworks",

);

GCC_PRECOMPILE_PREFIX_HEADER = YES;

GCC_PREFIX_HEADER = "LocationServices/LocationServices-Prefix.pch";

INFOPLIST_FILE = "LocationServicesTests/LocationServicesTests-Info.plist";

PRODUCT_NAME = "$(TARGET_NAME)";

TEST_HOST = "$(BUNDLE_LOADER)";

WRAPPER_EXTENSION = octest;

};

name = Debug;

};

D8E103641410263600A403DB /* Release */ = {

isa = XCBuildConfiguration;

buildSettings = {

BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/LocationServices.app/LocationServices";

FRAMEWORK_SEARCH_PATHS = (

"$(SDKROOT)/Developer/Library/Frameworks",

"$(DEVELOPER_LIBRARY_DIR)/Frameworks",

);

GCC_PRECOMPILE_PREFIX_HEADER = YES;

GCC_PREFIX_HEADER = "LocationServices/LocationServices-Prefix.pch";

INFOPLIST_FILE = "LocationServicesTests/LocationServicesTests-Info.plist";

PRODUCT_NAME = "$(TARGET_NAME)";

TEST_HOST = "$(BUNDLE_LOADER)";

WRAPPER_EXTENSION = octest;

};

name = Release;

};

/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */

D8E103221410263500A403DB /* Build configuration list for PBXProject "LocationServices" */ = {

isa = XCConfigurationList;

buildConfigurations = (

D8E1035D1410263600A403DB /* Debug */,

D8E1035E1410263600A403DB /* Release */,

);

defaultConfigurationIsVisible = 0;

defaultConfigurationName = Release;

};

D8E1035F1410263600A403DB /* Build configuration list for PBXNativeTarget "Locinator" */ = {

isa = XCConfigurationList;

buildConfigurations = (

D8E103601410263600A403DB /* Debug */,

D8E103611410263600A403DB /* Release */,

);

defaultConfigurationIsVisible = 0;

defaultConfigurationName = Release;

};

D8E103621410263600A403DB /* Build configuration list for PBXNativeTarget "LocationServicesTests" */ = {

isa = XCConfigurationList;

buildConfigurations = (

D8E103631410263600A403DB /* Debug */,

D8E103641410263600A403DB /* Release */,

);

defaultConfigurationIsVisible = 0;

defaultConfigurationName = Release;

};

/* End XCConfigurationList section */

};

rootObject = D8E1031F1410263500A403DB /* Project object */;

}

Screenshot.pngScreenshot.png

Editado por urielm

Compartilhar este post


Link para o post
Compartilhar em outros sites

Boas,

Bom a primeira pergunta que faria você já respondeu ao Ferbass.

Seu código abaixo:

- (void)getCurrentLocation{

if ([CLLocationManager locationServicesEnabled]) {

locationManager = [[CLLocationManager alloc] init];

locationManager.delegate = self;

locationManager.desiredAccuracy = kCLLocationAccuracyBest;

locationManager.distanceFilter = 500;

[locationManager startUpdatingLocation];

}

- (void)locationManagerCLLocationManager *)manager

didUpdateToLocationCLLocation *)newLocation

fromLocationCLLocation *)oldLocation{

// codigo omitido para obter a latitude e longitude

}

Se tiver com todas as libs do xcode vá em: projeto depois busque na coluna info :

url types

clique sobre busque: localization native development..... e veja qual é o valor ao lado se yes ou no.

Em tempo busque essa lib e outra que falta neste link : https://github.com/libgit2/libgit2

[]´s

Não tenho essa propriedade configurada. Qual o valor correto, yes ou no?

Obrigado.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Você afirma não ter nenhum erro porque nada acontece ou porque você verificou no console ou pelo debug?

O método abaixo está implementado para que você possa ver se está entrando nele?

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
}[/CODE]

Compartilhar este post


Link para o post
Compartilhar em outros sites

Você afirma não ter nenhum erro porque nada acontece ou porque você verificou no console ou pelo debug?

O método abaixo está implementado para que você possa ver se está entrando nele?

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
}[/CODE]

Está implementado sim, coloquei logs nos 2 métodos tbem... Fiz debug e não encontrei nada ainda...

Chega até aqui sem problemas, quando invoco o [color=#000000]startUpdatingLocation[/color] não da erro, não loga nenhum dos 2 métodos e fazendo debug tbem não chega a entrar no método.

[CODE]
[locationManager startUpdatingLocation];
[/CODE]

Com certeza o problema é na App, mas ainda não consegui encontrar o ponto, pois sem erro fica difícil encontrar algo.

Mas obrigado pela resposta.

Abs

Editado por sandokan

Compartilhar este post


Link para o post
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Visitante
Responder este tópico…

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Limpar editor

×   You cannot paste images directly. Upload or insert images from URL.

Entre para seguir isso  

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.



  • Conteúdo Similar

    • Por Danielly Santos
      To testando o Joga, vocês conhecem ?    1 0 250   Desde Hoje   Santa Catarina
    • Por Setangels
      Existe alguma restrição em utilizar um Apple Watch Series 4 44mm GPS comprado no Kuwait?
      Estou vendo os valores e se realmente vale a pena
      Como minha operadora é a vivo não pensei em pegar com o Cellular (pelo que andei lendo, o Cellular só funcionaria nos modelos europeus)
    • Por Eliézer José Lonczynski
      Meu app predileto para despertador GPS era o soneca busão, que infelizmente não funciona mais pra mim desde que saí do iOS 10. Alguém tem uma dica de App pago ou gratuito que seja desta função? Quero voltar a dormir despreocupado no ônibus rsrs
    • Por rodrigorox
      Olá!
      Depois das últimas atualizações do Google Maps, o feixe de direção simplesmente não aparece mais (aquela setinha no ponto azul da localização indicando para onde a bússola está apontando).
      Cheguei a conferir em celulares de amigos e continua exibindo normalmente.
      Alguém tem alguma ideia do que possa ser?
       
       

    • Por Diogo Ferreira Alves
      Boa tarde, pessoal.
      Tenho um Iphone 6 comprado em junho de 2015 e a bateria estava com problemas, comprometendo o desempenho do mesmo.
      Realizei o procedimento de troca de bateria mas o telefone começou a apresentar defeito no WiFi, Bluetooth e GPS.
      O WiFi só funciona quando estou a menos de 2 metros do roteador, o Bluetooth conecta e desconecta do carro e o GPS simplesmente não funciona.
      Realizei diversos contatos com a assistência técnica e com a Apple, mas a resposta é sempre a mesma, de que o aparelho não apresenta problemas e se eu quiser tenho a "opção" de trocar o meu aparelho por míseros R$1,5 mil. Extremamente indignado com isso, mas realmente não sei o que fazer quanto à garantia da assistência, e por consequência, da Apple.
       
      Em uma breve procura pela web achei diversas pessoas com o mesmo problema, que disseram trocar o "cabo flex" da antena wifi, e assim resolveram o problema.
      A peça custa em torno de R$50,00, mais os R$50,00 do kit pra abrir o celular.

      Alguém com o mesmo problema? Como resolveu?
      Abraços!
    • Por tkafa
      Boa noite a todos!
      Costumo usar meu iPhone X num suporte veicular com carregador QI (desses com ventosa, que se prende no parabrisa).
      Notei que ao utilizar o Waze, o sinal de GPS por vezes demora muito a atualizar. A posição fica extremamente defasada. Já teve vezes de ele simplesmente não exibir/encontrar a posição. Isso não ocorria quando eu tinha o 6s Plus.
      Outra coisa que notei é que o telefone fica extremamente lento enquanto o Waze está rodando. Ele continua funcionando mas o frame rate do sistema cai absurdamente.
      Alguém mais com este problema?
    • Por T-Bond
      Pelo o que soube, essa nova série não será comercializada aqui. É isso mesmo?
      Minha dúvida é se comprando a versão GPS+Cellphone ele vai funcionar aqui com as nossas operadoras.
    • Por Marçal Nardelli
      Salve galera, tudo bom?
      Estou indo para a Europa e vou precisar de um GPS OFFLINE para usar na viagem e seria bom continuar usando no Brasil quando voltar.
      Eu já tenho o GPS Sygic e Tomtom do Brazil. Só que virou um rolo pq antigamente o Sygic era dividido por país já na compra do app na App Store. Agora tem um app geral "Sygic: GPS Navigation, Maps..." que pelo que entendi deve-se fazer a compra do mapa com In-App Purchases, e ainda, um app "Sygic Car Navigation" que nem sei para que serve. No app Geral sygic vc n paga para fazer o download e depois sai coisa de $17,00 para comprar o mapa mundial por toda a vida com traffic. Já o Car Navigation não sei como funciona pois tem que pagar $0,99 só para sorrir...
      Se puderem me ajudar e me falarem como está funcionando o TomTom.
       
      Valeu!
    • Por Eduardo Garcia
      Pessoal, gostaria de saber se mais alguem notou que o gps do iPhone 7 nao esta tão preciso quanto ao do iPhone 6?
      Eu notei isso jogando Pokemon Go pois ligo aqui em casa e o personagem começa a andar pelas redondezas.
    • Por CleberTM
      Boa noite, galera
       
      alguém aí sentiu diferença no sinal de GPS após atualização para o 8.3?
      ontem fui usar o waze e o sinal além de instável, ficava mostrando que eu estava em outras ruas (próximas da que eu realmente estava).
      Achei que o problemas era no app e liguei o Google Maps, mas deu o mesmo problema...
       
      Isso aconteceu no meu iphone 6 e tinha outra pessoa no carro com um iphone 4 e tava tendo o mesmo problema...
      mais alguém ai passou por isso também?
       
      abs,
       
  • Estatísticas do Fórum

    • Total de Tópicos
      47.530
    • Total de Posts
      407.959
×
×
  • Criar Novo...