Significant location change doesn't work on Wifi only devices - ios

Correct me if I'm wrong, I have two devices (iPhone), one with sim-card included and wifi connected, other doesn't have an active sim-card but connects to wifi. I was on train to test the significant location change on both devices, only the one with sim-card sent significant location change event. The one without sim-card didn't fire any event even though it still connected to Wifi.
Any link references are appreciated. IMO, does the significant location change only work with cellular data ?

I believe the significant location change updates location only when the phone swap from a cellular tower to another, so if it is not on the cellular network (without sim card) it can not detect that, and therefore cannot provide a position :)
From Apple doc:
The significant location change service is better suited for apps that want to get the user’s initial location and then only want to know when that location changes. This service requires the presence of cellular hardware and delivers events less frequently than the standard location services.
Source

Related

How to get location by GPS without network in iOS?

I use CoreLocation Framework to get location, when in network it work normal , but when without the network, it can not locate always. it will not stop receiving location information after seconds. I want to know how to use GPS locating without network?
I think you are using your device in a house or building, where the device can't receive GPS satellite signal.
If that's the case, what you are seeing is the expected results. iOS internally keeps the last location (cache). When you start location updates, iOS passes that cashed location quickly to locationManager(:didUpdateLocations). When no network nor satellite signal, no location update will be sent thereafter.
If your device is receiving wifi w/o satellite signal, iOS determines the rough location by using the wifi, and sends location updates. You can't distinguish the source of location updates; they could be from wifi or from GPS satellite. (actually, you can guess by seeing the accuracy. when the source was wifi, accuracy was fixed to 50m w/ my iphone.)
One way to check if your location update is cached or not is to check the time stamp of location update.
The cashed location update should have older time stamp than when you started location update.
So, to your question, you are doing just right thing. Location manager is very easy to use. Try to receive satellite signal in open sky w/o network. For your tests, don't move. It may take 5-7 minutes at most. If you move, it may take longer. Hope this helps.

Difference between Mobile-centric and network-centric

I am new and I hope I am posting in the right section. I am developping an iOS app using indoor advertisement. The app scan fro iBeacons and when it detect one it sends a get request to the server which determine the position of the mobile device and send back a response. I found this text on the internet
Mobile-centric and network-centric technologies are different only in
where the data and/or logic resides for calculating the location of a
mobile device. For example, the American Museum of Natural History’s
original Explorer mobile wayfinding app used Cisco’s Mobility Services
Engine (MSE), which was a device that sat on the network and processed
the raw signal-strength data provided by the mobile device to
triangulate the location based on a map that was managed and stored in
the MSE. The new Explorer still uses triangulation to determine the
phone’s location. However, the map and beacon locations are downloaded
to the phone, and processing is done locally in the app.
Considering this text, in my use case I am using a network-centricsystem bacuase the location logic reside in the server. Is that true ? I thought that device-centric location is when the mobile device scan for beacons and network-centric is when the beacon send it's position to the nodes.
Beacons are devices that send signal all the time. Also mobile device is scanning for beacons all the time. Those things doesn't change based on technology. You are using network-centric technology. So what is the diffrence:
Mobile-centric
location is calculated on your phone
Network-centric
data is send to server which returns your location based on given data
Network-centric is often used when doing task on phone may:
drain too much energy
be not fast enough
I'd say that triangulation doesn't require server for calculations as is quite easy and you may notice, that waiting for server response may be not fast enough for displaying location to user.
In your case you're using a mobile-centric. Your mobile device is determining where it is at by using its physical distance to a an iBeacon. You have to tie a beacon to a location so you phone will say, "Ok, I see beacon 1 which I know is in Room A".
If you were going for network-centric, then the iBeacons would be telling the mobile device where it was. (even though this is not how iBeacons work but as an example) The beacon would be discovering the phone and saying, "Hey mobile device, you're in Room A".
So you see in the latter the network is telling the mobile device where it is, thus "network-centric". Where in the first case the mobile device is determine where it is, thus "mobile-centric". So even though you are pinging a server for the data associated with a location, the device is still telling the server where it is in physical space based on the proximity to a beacon.

Significant-Change Location Service will use Wi-Fi or Mobile Data?

When use Significant-Change Location Service it must use Wi-fi ? Without Wi-fi this service will work or not?
Theoretically it should work but location mechanism is a bit complicated in iOS.
iOS devices uses a system called aGPS. Which relies on combination of gps, cellular, wi-fi, geofencing etc. Wi-fi is the fastest location update option for the location manager since you can get your accurate-enough information immediately. GPS is the most accurate one but it takes couple of minutes to lock and determine your location if you changed your location a lot since the last lock on.
So maybe you had an impression that when wi-fi is disabled significant change location service doesn't work but actually it does. At least this is the expected behavior.

In ios, is it possible to know if the GPS location is not being updated?

I'm creating an app that allows the user to navigate with a map when offline (no internet connection or wifi available), and I want to let the user know if the gps location not being updated. I know I can get the last updated location timestamp and the accuracy, but is it possible to know if the gps has no reception?
No, there's no public interface for finding out about the state of specific location hardware such as the GPS receiver.
The Location Manager abstracts all that away, so that developers can get location and accuracy information without worrying about whether the device used GPS, Wifi, iBeacons, cell tower locations, Loran-C, celestial navigation, etc. to determine the location. This is generally a very good thing because it means that your apps work on all devices regardless of whether they have GPS, and will continue to work (and maybe even work better) on new devices that might use other technology. But it also means that you don't get to ask the question "is the device receiving a GPS signal right now?"
Is it possible to know if the GPS location is not being updated?
No. It doesn't seem possible given the available API.
There are a few things about GPS to consider, if you haven't already. It is technically possible to receive a location update from CLLocationManager when you're "offline" but it will depend on several things:
If your device actually has GPS hardware. Some don't.
If you have line of sight to GPS satellites. There's a difference between GPS and A-GPS
Those true GPS updates will come much less frequently because of the way GPS works, but it should work.
... but is it possible to know if the gps has no reception
Based on the way GPS works (as best I understand it) you either turn the radio on/off (-startUpdatingLocation/-stopUpdatingLocation) with the Location Services API and you either get locations more frequently with A-GPS or infrequently with pure GPS when you don't have a network signal. I don't think the Location Services API has a way of telling you "I don't have a GPS signal at all."

How to get the location provider name in iOS?

In Android whenever you get location object you could call "location.getProvider" on the instance to get value like "wifi". Is there something similar in iOS (CLLocation)?
The Location Awareness Programming Guide says:
The [CoreLocation] framework uses information obtained from the built-in cellular, Wi-Fi, or GPS hardware to triangulate a location fix for the device. It reports that location to your code and, depending on how you configure the service, also provides periodic updates as it receives new or improved data
Having said that, you do not have access to how precisely the CLLocationManager determined your location (other than, if you used significant change, that it probably used cell towers). You theoretically could use Reachability to see if you have Wi-Fi availability, but you have no assurances as to what mix of GPS, cellular, and Wi-Fi it used to get your location (even if you happen to have WiFi connection).
What you do have is horizontalAccuracy, which tells you approximately how accurate the location you received is. From a user's perspective, that's probably a more important piece of information.
There isn't a concept of what system provided you with the location on iOS. What you can do is check what the accuracy of the location is. Based on how precise the location is, you can probably surmise if the location was provided by a GPS signal.
The reason this isn't given is that iOS will provide you with an initial location which won't be very accurate (likely based on geo-ip or cell triangulation) and then update the location with more and more precise coordinates if GPS is available.
If your application requires the accuracy provided by a GPS chip, you can add UIRequiredDeviceCapabilities = gps to your Info.plist.

Resources