cllocationmanager

CLLocationManager monitoredRegions (NSSet) is not correct, or maybe something else?

早过忘川 提交于 2019-12-05 03:20:54
问题 I want to check every time the user passes a store from an array of stores, I have more than 20 stores so I wrote a function that finds the 20 closest stores to the user’s location and monitors them. The list being updated on locationManager: didUpdateLocations , I also replace the old 20 monitored regions with the new 20 closest stores location. The problem is that locationManager: didEnterRegion isn’t being called regularly when the user enters a region. I’ve also noticed that when I check

[iOS]capturing user location: clarification

£可爱£侵袭症+ 提交于 2019-12-05 02:38:05
问题 I've an app that capture user location and send this info to my server. I've started the LocationManager service with: - (CLLocationManager *)locationManager { if (_locationManager == nil) { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; isUpdatingLocation = NO; } return _locationManager; } -(void) startLookingForLocation{ [self locationManager].desiredAccuracy = kCLLocationAccuracyBest; [self locationManager].distanceFilter = 250; if([[self

didUpdateLocations never called

大城市里の小女人 提交于 2019-12-05 02:26:08
I'm trying to get the user's location. To do so I have set the following property in the info.plist : I have also added the following code in my viewDidLoad method as well as the function below. The problem is that the locationManager(manager, didUpdate....) function never gets called, I also never get prompted for permission to access location, even though I have removed and installed the app again. I am testing this on my iPad, not on the simulator. The didFailWithError function never gets called either. self.locationManager.delegate = self self.locationManager.desiredAccuracy =

iOS: Can I manually associate wifi network with geographic location?

独自空忆成欢 提交于 2019-12-05 02:20:39
问题 Is it possible to make the phone to "know" that a specific wifi network is at specific geographic location? if (answer == YES) { than how? } else { can the phone figure this out by himself? } Another similar question: is there any way to start monitor a region with accuracy of ~100m but telling the CLLocationManager to use only by wifi networks and cellular antenas? Because I don't want to power up the GPS no matter what... Thanks! 回答1: iPhone positioning sucks and there is nothing you can do

iBeacons: If app is in background, locationManager: didEnterRegion: is called only when lock screen displayed

纵饮孤独 提交于 2019-12-05 01:24:49
I'm working on an iOS app that monitors for iBeacon regions. When the app is running in the background, I want it to send a local notification whenever it encounters a particular iBeacon region. Everything works fine, except for one thing: locationManager: didEnterRegion evidently doesn't get called until the user displays the lock screen. So even if the device passed through an iBeacon region while the app was in the background, they don't get the notification until they display the lock screen. I've also tried using startMonitoringForRegion, and that sort of works -- if the app is running in

Remove fired Location-Based notification when user exits region

女生的网名这么多〃 提交于 2019-12-05 01:00:25
I've setup (default iOS8) location-based notifications for my app. UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.regionTriggersOnce = NO; notification.userInfo = @{ @"notification_id" : @"someID" }; notification.region = region; notification.alertBody = alertBody; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; When a user enters the specified region, the notification is shown in the NotificationCenter correctly. However, I want to remove that notification message when the user exits that region, because it makes little sense

iOS iPhone show user direction and orientation in space like the compass app on MKMapView

非 Y 不嫁゛ 提交于 2019-12-05 00:20:20
问题 When the compass app uses a map view to display it's location, there's a little cone that displays the direction in which the phone is pointing. However, I was unable to reproduce it using MKMapView that shows user's location. Is this cone of sight feature available to developers, or will I have to implement one myself? Thank you! 回答1: I faced a similar situation. I don't think we have library or settings to display the direction on the blue icon (at least my search was not successful).

On which iOS devices exactly is region monitoring supported?

不打扰是莪最后的温柔 提交于 2019-12-05 00:16:00
From what I can interpret from the runtime requirements of sample region monitoring code of Apple , region monitoring is available on iPhone 4, iPad 2 Wifi + 3G or later. So I'm assuming that it's not available on iPad1 with 3G, or iPhone 3G/3GS. Is this a correct interpretation? I cannot test this since I don't have all those devices and I couldn't find an official documentation about this. PS: I know that I can check for it in the code by calling regionMonitoringAvailable method but I need this information to decide for the architecture of my app, so I need to know this upfront. From what I

Does CLLocationManager works without internet?

对着背影说爱祢 提交于 2019-12-05 00:02:11
Silly question !! Though I want to know that is it possible that CLLocationManager works without Internet ????? i.e. iPhone is not connected to internet at all iPhoneiPadDev's answer is slightly wrong: whilst sometimes the location manager will fail, it can work without network connectivity. If you want to see this for yourself, go for a drive somewhere with terrible or nonexistent cellular reception: GPS will still work. It very much depends on the environmental conditions around you, and the device you're using. iPod Touches and some iPads don't have GPS, and rely on WiFi hotspots to

CLLocationManager.location is nil

好久不见. 提交于 2019-12-04 20:27:48
问题 this is my locationManager init method: func initLocationManager() { seenError = false locationFixAchieved = false locationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestAlwaysAuthorization() locationManager.startUpdatingLocation() } after calling this method this line println(self.locationManager.location) prints nil why is that? it worked for me well at the past i just made few changes in my app