How to update Geofencing list of points in iOS into Background - ios

I would create an iOS application with geofencing.
Can I send a new list of geofencing points to this app through Apple Server in Background or must I launch the app to update its list of points ?
More easily, can I from an external server change the geofence point without launching the app ?
Thanks you very much.
Best regards

Assuming your app doesn't use any of the available background modes, you can't change them remotely. The push notifications are received and shown by the OS, and only opening them will trigger your app to load and execute your code.

Related

Show a custom notification at the moment the app update finishes?

I need to notify the user about new features of my app as soon as the app update finishes and the app is not in the foreground (i.e., it is terminated or is in the background). How do I achieve this? This scenario will happen if the app was already installed and auto-updates were on.
I achieved this on Android using MY_PACKAGE_REPLACED broadcast receiver. I've read about NSNotificationName in NSNotificationCenter in iOS but couldn't find an equivalent to MY_PACKAGE_REPLACED.
You cannot do this with iOS without the app running in the background Period. Even if your app is running in the background after Appstore updates the app, your app gets killed and you don't have control over it until the user launches it for the first time.
Maybe you could try sending a silent push notification to the app to see if it responds and try to get the current app version.

Open iOS app automatically at a certain time

Is this possible? Like the app will launch at 8AM and closes at 10PM. I'm new to developing an app that uses background. What I do know currently is that the app can run in the background for a long time.
What I also have right now is my project that updates the user location in the background. With the help of this https://github.com/silento/Location - re-written in Swift 3.0.
This is not possible. But, you can use local notifications to tell user to run the app.

IOS limitations when running on background

I searched informations about possibilities when running an iOS app on background, but I didn't found same on different sites.
My application has to read the battery level (with step of 1%) and the time, but I don't know if I can read that when running on background.
Please if someone is sure about it or know a site to read these infos, it will be very nice.
EDIT : I've one more question, can I just open my app (to perform more actions) when the notification center return a battery state under 5% for example ?
No, you can't.
It's not possible to let your app running on background, it's iOS system's limitations.
In iOS 7.0 and later, you have opportunity to do some pre-fetch stuff even your app is not running, through the method like application:performFetchWithCompletionHandler:, but you should tell the device by posting remote notification from your server.

What's solution to make task background in iOS same service in Android?

I'm newbie iOS. I have been develop Phonegap for Android and iOS. My App is update data from server every 1hour. In Android, i use service to do that. My app in Android working very good. Now, i want to develop version for iOS, and i have problem when update data from server every 1hour. I was research but not find anyway for my app.I don't know what's solution to replace for service in Android. Can you help me, what's solution. This have been kill me. Thank you so much.
Short answer is NO as Apple has restriction on background task running especially cases like yours.
But if you are downloading small amount of content, you do have some other options. From IOS 4.0 or above, you can declare your app to run in background when you fall under the following categories:
Audio
Location updates
Voice over IP
Newsstand downloads
External accessory communication
Bluetooth networking
Bluetooth data sharing
Background fetch (IOS 7)
Remote notifications (IOS 7)
In order to do so, you need to flag your app in the info.plist for Required Background Modes option. Apple will review your app specific in this area once you declared the option.
For your case to download the data, the possible option is to use the new feature in IOS 7 that's the background fetch or remote notification above. The suggestion from DOM was not asking you to download the content through push notification. But instead to use push notification to wake up your application and start downloading new content.
If you don't want to use push notification, the only way to go is register for background fetch. However, no matter which option you want to use, each download will only last for 30 seconds. And after that, your app will put into suspension mode again.
you can have a look on the link here:
Declaring Your App’s Supported Background Tasks
I think your best bet would be to use the push services instead of having your app go get data. Making your app do it is unreliable with phonegap apps because you cant create a service interface and you can not guarantee that your app will be running. With push service though, if your app isn't running, it will be woken up in a manner of speaking.
Take a look at this great how-to article that also discusses what push provides you.

Create Geolocation plugin for phonegap iOS to run in background

since watchposition doesn't run for more than 30 min in background, i have to create a geolocation plugin in order to register position every 5 minute on my webserver.
Ther problem is that i don't know quite nothing about objective-c. So anyone can help me or give me some parts of code with i can do something? thanks in advance
You don’t need to create a plugin for your phonegap app to receive location updates in the background. I’ve produced an iOS version of my phonegap-based navigator app and successfully got it receiving position updates while running in the background. I’ve tested it extensively in the “real-world” and it works reliably without any limit on the duration for receiving location updates.
Firstly, you need to be using XCode to develop your phonegap app - I’m not sure you can set the correct properties in your iOS app if you’re using Phonegap Build. You can set the “UIBackgroundModes” key with a value of “location”, which will cause iOS to trigger the JS callback function you have registered with watchPosition() each time a location update is received.
See this page for details about iOS project keys.
See this page for how to set the background modes key in XCode. The value you want to select is “App registers for location updates”.
Hope this helps!

Resources