start app automatically at some time on jailbreak IOS devices - ios

I have created an iOS application and one of the new features that the client wants me to add is -
if the app is in the background and the user does not touch the device's
screen for 60 seconds, START THE APP AGAIN.
I have searched and found this article: http://n8henrie.com/2012/07/scheduling-ios-apps/
but this is not very helpful, because I must achieve this task programatically. The app will run on 200 devices, and I can't do those steps with each one.
Any ideas?
IMPORTANT: I'm willing to jailbreak the device if it is not possible is some other way.

Related

iOS/Xcode: is there a difference between running the App on an iPhone while connected to Xcode compared to opening the installed App afterwards?

I have a Timer which plays AVAudio at a specific time while the screen is locked (app in foreground when locked and plist setting 'Application does not run in background' set to YES).
When I run my code while my iPhone is connected to Xcode it works as desired, playing audio while locked even when the iPhone has been locked for hours.
Now if I disconnect my iPhone and just open the app by tapping the icon the audio won't be played if it's set for more than a minute.
Is there a difference that causes this problem? If I would publish my App to the AppStore which behaviour would my users get?
That 'Application does not run in background' flag is a very old flag that means your app does not support multitasking and should be terminated when the user presses the home button. There's no good reason I can think of to set that flag on a newly developed application. Unless you understand exactly what it's for and are positive that setting it to yes is the correct thing to do, don't do that.
(That flag was added when iOS 4 was released, to allow apps that could not handle multi-tasking to request the old terminate-on-home-button behavior from iOS 3. Given that we're now 6 major iOS releases from iOS 4, it seems outdated.)
So remove that flag. It probably doesn't have any impact on your question, but remove it or set it to no in any case.
If you want to run a timer while the phone is locked and play sounds at designated times then you will probably need to set your app up as a background sound player, and ask for more background time when you get a message that you are going to the background.
That being said it's likely that Apple will reject your app. Running a timer from the background means that the processor on the phone has to run at full speed all the time, which will DRAMATICALLY reduce battery life.
Apple only allows a very small subset of apps to run in the background, and then only under specific circumstances (like a background sound playing app when the user is actively listening to music, or a navigation app that is actively tracking the user's location and notifying them when it's time to make a turn to follow directions.)
Should be no different. If you'd like to feel what do your users' feel then you can publish it to TestFlight which is the best app beta test environment. Find some testers or try it yourself.
The directions should be to verify the playing logic and the sound file relationship which link to the connection.

Program an iOS app to launch itself at specific times

I'm developing a medical alert and record keeping app for iOS for a client. The app needs to be able to open itself at specific times based on a schedule that is set remotely.
I've searched around for how this can be done, and I keep running into other apps that let you schedule app launch times, but this needs to be a self contained solution.
I'd rather not JailBreak the iOS device to make it work, and I've come across articles that say iOS 9+ now has this capacity, but no instructions on how to make it come about.
Any clues, tutorials, or other information on how to accomplish this?
You can use "silent" push notifications (with "content-available") on iOS 7+ to launch the app when the push notification is received on the device. You will get a chance to process the notification, and the app will be launched if it's not already running.
However, it still won't work if the user has force killed the app.
Also, iOS will not launch your app if it feels you've gone over the daily processing time or data quota.

Apple Watch : will the App on iPhone run in the background

Am trying a simple Apple Watch App. the question I have is : will the iPhone App be able to run always in the background? In the App, I want to fetch some files from a server & store them in the iPhone (I want to do this everyday at a specific time), so that when the user opens the Apple Watch App, the file can be showed immediately (and no need to wait for it be downloaded then).
You can run tasks in the background of an iPhone application yes. I have no idea about how this interacts with the Apple Watch (your post suggests this will just sync automatically perhaps). Good point of reading:
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

Can throwing the iPhone high in the air launch my app or trigger desired function in iOS 7 or later

My app is an emergency app. It will be used by people in emergency and disasters.
It's possible that they got stuck in situations where they just don't have the time to enter or draw their password on the lock screen, launch the app and push a button. Is it possible that my app can ask the OS to launch the app if user throw their iPhone up in the air or shake it vigorously or something else.
What I wish to achieve by this ?
I want that OS launches my app in background if the user say shake his/her iPhone vigorously. Once launched my app will make a network request and keep running in background for short time.
PS:I think it's possible with the accelerometer.
Accelerometer will not work because Apple doesn't allow background processes opening apps. In your case, user must be opening the app by himself/herself manually. (PS. As far as I know, it's possible in Android)
iOS background tasking problems aside:
Apple don't allow apps that encourage the user to do things that might damage their iOS device. So your 'throw in the air' idea is out.
As for shaking the device -- this just isn't practical. What if the device gets shaken by accident? You've then got false alarms to deal with.
The crux of the issue is that something that triggers an emergency response should be a deliberate action which is hard to do trigger by accident.
This cannot work - and here's why.
Your app would need to run in background to handle motion events. Apps running in background can get killed at any time, i.e. if memory gets low. There might be some restrictions about running and and resource usage as well.
An app in the background cannot bring itself to the front.
Launching from a locked screen would bring great security risks.
Throwing into the air seems like a gesture that can easily be triggered by accident.
I must admit that I'm pretty happy that those apps are not allowed on the AppStore - as it would open many doors that I'd like to see kept close.

App to control iPad power status

I would like to figure out if it's possible to create an app which, after launch, will switch to the background and will be basically a "timer" to control turning the device ON or OFF (or maybe just regaining control and be "in the user's face") when 30 minutes have elapsed.
I do understand that an app like this is not going to be approved ever. And I would like to NOT jailbreak my iPad. To give a bit more context -- I just want to limit the time children can use the iPad. I do have an iOS dev account, so I can sign the app, use a provisioning profile with my target device, and install it there.
Is it possible, and where should I be looking into this? Obviously it's not a part of iOS SDK.
If you want you could make something with push notifications (for example, after 30 minutes on iPad you will see "it's time to leave iPad and eat breakfest"). You cant make app which will "open" after time. Everything in background is very limited by iOS — there are push notifications and they should be used for every event.
If you want to do it you must jailbreak your iPad.
Edit:
I have a great solution for you.
Make a Web application that connects to iCloud and remote lock iPad. I have tested it and it works great — when you are doing something it is closing app and you must enter pin. Your Web application should turn in every minute and check if time has passed.

Resources