iOS background processing

12 views
Skip to first unread message

Hai James Zeng

unread,
Dec 18, 2014, 12:46:35 AM12/18/14
to stl-mob...@googlegroups.com
Hey Gurus,

I'm developing an app to track other apps running on the phone. In Android, it's pretty easy to do. But in iOS, looks like there's no way to keep my app running in the background and keep tracking other apps. I want to track some info such as which app is currently running in the foreground, and when it is turned off or switched to the background.

Please shed some lights.

Thanks,
James

Heath Borders

unread,
Dec 18, 2014, 10:30:39 AM12/18/14
to stl-mob...@googlegroups.com
How are you tracking other running apps in iOS? I wasn't aware of API to do that. To my knowledge, there's no way to force your app to continue running in the background. You could probably improve your odds of remaining backgrounded by reducing your CPU and memory usage. Additionally, I think the system wakes up your app when you receive a remote notification.

-Heath Borders
heath....@gmail.com
Twitter: heathborders
http://heath-tech.blogspot.com

--
You received this message because you are subscribed to the Google Groups "STL Mobile Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stl-mobile-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark S.

unread,
Dec 18, 2014, 9:39:39 PM12/18/14
to stl-mob...@googlegroups.com
James - 

AFAIK, you can still check to see what processes are running using standard UNIX C-style system calls (i.e., think sysctl).  However, it should be noted, that wouldn't be approved if you were submitting to the store.  

Check out the document below to see what the various modes of background operation are. Depending on the permission(s) you request, you may find the iOS SDK will refuse to perform some other unsupported behavior (such as system-level calls), but it's work a shot, I suppose, if someone is paying you to do it!


For example, see "Fetching Small Amounts of Content Opportunistically".  You might be able to get your task scheduled in the background via that permission, and use it to sample the processes running.  

As far as getting the continuous ability to run a spyware task to look at processes running on a device, you can't do that without rooting the OS.  (One more reason to own an iPhone!)  

Not sure what you're aiming for, but if you just want to see what's installed on the device, major companies such as Twitter manipulate UIApplication's canOpenUrl.  See: https://twitter.com/aykay/status/537976040996749312

Thanks,
Mark

James Z

unread,
Dec 18, 2014, 10:51:24 PM12/18/14
to stl-mob...@googlegroups.com
Thanks Heath for the reply. Why can't we make the app like an alarm type of app which can run in the background until the setup time is up, right? So, if we set the time to unlimited, I assume it'll be able to run in the background constantly. Is that right?

So, there's no API that returns what app is currently running in the foreground or background? and how much time it has been running? what's the battery and memory consumption, info like that?


On Thursday, December 18, 2014 9:30:39 AM UTC-6, Heath wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to stl-mobile-dev+unsubscribe@googlegroups.com.

Heath Borders

unread,
Dec 18, 2014, 11:14:37 PM12/18/14
to stl-mob...@googlegroups.com
>AFAIK, you can still check to see what processes are running using standard UNIX C-style system calls (i.e., think sysctl).  However, it should be noted, that wouldn't be approved if you were submitting to the store.  
Yes, this would probably work. I assumed he needed to be able to submit onto the store. Good job thinking outside the box. :)



-Heath Borders
heath....@gmail.com
Twitter: heathborders
http://heath-tech.blogspot.com

To unsubscribe from this group and stop receiving emails from it, send an email to stl-mobile-de...@googlegroups.com.

James Z

unread,
Dec 18, 2014, 11:43:55 PM12/18/14
to stl-mob...@googlegroups.com
Thx Mark for the link. Those are useful. I want the app to run constantly in the background, not sparkly or being waken up when something changes. If it works only when rooted, then it's not for regular users. How sad that Apple doesn't allow that. 

Rob Dickerson

unread,
Dec 19, 2014, 1:39:53 AM12/19/14
to stl-mob...@googlegroups.com
Apple's philosophy with the App Store is to make sure users are confident that the listed applications are never malicious or invasive of privacy. From that perspective, it's a pretty reasonable policy to disallow apps from getting blanket access to the type of data you're talking about. FWIW, I can't think of any case where I would fail to immediately uninstall a mobile application (iOS or Android) if it was constantly monitoring my device's running processes.
--
Rob Dickerson
rc.dic...@gmail.com
Reply all
Reply to author
Forward
0 new messages