I'm building an app that takes the user's location and checks if he's near one of his friend's house (all the friends addresses are stored in NSMutableArray from his contact list), if he is, it sends him a push notification.
Now, I'm trying to figure out how I can get the user's location when the app is in the background (and even after the user killed the app from the multitasking screen).
I need to analyze his location and check if he is near one of the addresses on the array.
Does anybody know how can I get the location? Thanks!
Related
I have an iOS app on the app store that can:
show the user location on a map when the user clicks on a GPS button
record a tracking of the user location when the user clicks on a record button
That app passed validation in the past. I recently made an update that changes nothing to the location stuff, and that has been refused because of the message displayed when requesting the location permission to show the user location on a map (so, when the user clicks on the GPS button).
The message was:
MyAppName needs to access your location to show it on the map.
Seemed pretty clear to me, but reading the guidelines I saw that we should not display the app name. So I updated it to:
Your current location will be displayed on the map.
Which is nearly the same as the message of the guidelines. Rejected again. When the user clicks on the GPS button, the app does nothing more than showing the location on the map.
When the user clicks on the record button, a different message is displayed:
Your current location will be used to record a tracking. The setting must be set to "Always Allow" in order to record the tracking even when the app is in the background.
I explained all of that in an answer to the app rejection message and I'm waiting Apple's response. In the mean time, in order to avoid losing even more time, I'd like to know if someone ran into a similar problem, and what message did you display to pass validation?
Sooooo in the end, they validated my app, after a new message explaining in details the two different use cases (leading to the two different permission requests message).
Right now I build an app that provide sync contacts. For that, every time the app comeback to foreground, I check all contacts(CNContact) and compare to my contact in app's core data and detect if any contact that different and merge the data. It works okay but it takes a lot of memory.
Is that any way to detect if any contact in contact app has changed without comparing all contact?
I want to make a app which will find nearby coffee shops and push notify users if found any within 1 mile.
I just wanted to make sure How it can be done
This is what I have thought about till now
Get users Location
Update every minute in background and find if changed
If changed, find nearby Stores from the database on server
If found any nearby Stores, Push Notify user on their phone.
1 notification per store, so if same store found in same location, it won't send push notification again.
Please do tell me, if this can be done. I'm just not sure about background location updating in background or even if the app is closed.
I will suggest that you take a look at Parse.com - A very mobile-friendly (both android, win and iOS) DB and library system. Easy to set up to user location and geolocation for your stores. Parse has an in-built push notification system, that works really easy, which could be triggered by how far you are from a store. Parse's DB is scalable and free to use until you reach a high level of user traffic in your app.
Take a look: Parse.com
I am building an iOS app in Corona SDK and am trying to implement a map feature where the user can see where they are compared to where others with the app open are. What would be the best way to go at this?
I already wrote the code for finding the current location of the owner of the device, but how do I retrieve data from other users?
Any advice is greatly appreciated!
This is very broad question, but basically you need a server (on the web) where each user's location gets stored while the app is open, and the app can request the location of other users specifically, at some time interval. Presumably you would need to have some form of rights management since every user would typically be interested in seeing only a small number of other users, and every user would want to have control over who can see their location.
One thing to remind users of is that the reported position is that of the device, not that of the user, and that it is the last reported position, not necessarily current (not all devices are on cellular network or wifi at every moment), so you'd also want a time-of-last-update to be shown with every location marker.
In my app, I am using CLLocationManager to get user's current location.
The problem is, most of the time, user would be indoor, or not very far from the building entrance when they launch my app for the very first time. As a result the location I get is not very accurate(more than 1km off).
Yet, at the same time, if I open either Google Map or Apple Map, they are able to display location with little discrepency(a few hundred meters). How they manage to do that ?