Update users location even when app is terminated - iphone

Hi I'm new to iPhone app development. I need to update users location even when app is terminated or killed by users. Is it possible in swift code?

You can track the user's location while your app is still active in the background if you are registered for background updates, which you can find out how to do here. However you can not track a user once they have quit your application.

Related

How do I get notified when user starts messaging or mailing app in iOS

Actually I want to build such a iOS app which will give alert if user start sms application or messaging application when he is driving more than certain speed limit. As I am new in iOS development I don't know whether it is feasible or not?
Basically my id:
Q: How do I get notified when user starts messaging app?
Due to iOS sandboxing restrictions, you cannot get any information from your app regarding launching or usage of any other apps.
The only way to do this would be if you were the developer of both apps. In that case you could use an external server to log when each of the apps is launched and then get this information from the converse app.

Does an iOS app continue to run in the background after an App Store update?

For example: would a VOIP app, which has an open socket which is notified of incoming traffic before the App Store update, have a chance to re-establish that socket after an App Store update? Or does the App have to wait for the user to open the App first? I can't find any answer to this in any Apple documentation.
I believe that the app is shut down (terminated) before updating, and I don't believe that the system automatically restarts them after updating (geofencing and related tasks should still work, though).
Think about it: when you get an update for Bob's Awesome Application on your desktop, you have to shutdown the app before installing the update.
After the update is installed, Bob's Awesome Application doesn't restart itself - that would just be weird - and quite annoying.

Required Background Mode for location not re opening app after reboot

We are trying to develop an application similar to an existing app currently in the app store.
This app is sending location data in the background to a web service, and the app will continue to run following a reboot of the device. I will also note, that following the app being installed and registered, the location services indictor remains constantly on the status bar. I am assuming this is necessary to allow the app to continue to run following a the device being restarted.
We have tried using the "UIBackgroundModes/required background modes for location", and have been unsuccessful in having the app continue to run following a reboot of the device.
Can someone please point us in the right direction as to how to have the app continue to send location data following a device reboot.
Thank you very much!
No app will run following a device reboot. It is not possible to build a file daemon under Apple's SDKs. You'd have to jailbreak the phone and run unauthorized stuff to do so, then you wouldn't be accepted into Apple's app store.
Yes your app will be restarted if your are monitoring significant location changes or monitoring a region and that region is entered/exited.
In iOS 7 Apple made an important change that will disable these mechanisms if a user force quits your app. They will remain disabled until the user starts your app again.

auto upgrading iOS apps

Is there some way to implement an auto-upgrade for an iPad app.
I would like to be able to have my app check for updates, and then upgrade itself.
As far as I am concerned the app can retrieve the update from the app-store, but:
I would like the interface to be app internal: User should just have to press an OK button for the upgrade to start (all this time staying within the app)
Is this possible at all?
It is possible to have display a notification to inform an update is available on you app and you can redirect the user to the AppStore, but an update can only be download from the AppStore.
This will reinstall the new version of your app. So you can't stay in the app to update (You need to go to the appStore and qui the app during the update).
Internally, you can only update some content for you app (not add new native code) but not with a real AppStore update.
Apple does not allow apps to download, install, or execute code that is not included in the original app submitted to Apple. The App store upgrade cannot be automatically started.
the best you can do is determine if the app store has a newer update, then prompt the user to install it by linking directly to the app page in the app store. They will still have to click the correct buttons to start the process.
Even if it were possible, it's not allowed by Apple. Your app will be rejected.
Unless you only update contents of your app, e.g. cooking receipts.

Is there a way to re-trigger asking the user if the iPhone can use their current location?

For some reason, my iPhone app doesn't ask the user for permission to use their current location when the app is installed from the App Store. Because of this, my app's location-based functionality doesn't work. I'd like to catch the error and re-trigger the functionality that asks the user for permission to use their current location.
Is there a way to re-trigger asking the user if the iPhone can use their current location?
No, this is a bug in iOS 4.1, you'll just have to wait til iOS 4.2 is out and re-release your app.
They most likely have location services completely turned off in Settings or even have it off just for your application.
You can use:
[CLLocationManager locationServicesEnabled]
to check this and alert the user or track it for your own purposes. Core Location should ask the user to enable Location Services in the case of the first scenario. If the second scenario is happening, then there is nothing you can do except tell the user to turn on location services for your app.
There is really nothing you can do programmatically outside of the CLLocationManager handling all of this for you.