Block-distraction apps for iOS - ios

I want to write an iOS app that helps users concentrate on their work by preventing them from accessing particular apps on their devices for particular amount of time.
I googled around and found some "help-to-concentrate" iOS apps, but they mostly just help us to keep track of our usage of the phone (amount of time we spent on the phone, number of times we turn on the phone...). So, I do not know whether it is possible write an iOS app that can block some other apps on the device for a period of time or not?
If it is possible, can you please suggest me any keywords or Swift libraries that support this task?
Thank you.

Since Apple doesn't allow any app to access the files of other apps, it is impossible. It's just a safety measure for the users. Just use another practice to keep users "concentrated".

Related

disable internet on other ios apps

I'd like to create a very simple app to block internet access for certain app's between 7PM and 7AM on my iPhone.
However the mobile phone & imessage should stay usable, so it's no airplane modus.
This is to have some "no notification time" and don't see for example new e-mails coming in.
Would this be possible to archieve? Can an app control this behaviour for other app's?
Thanks a lot in advance for your answers!
Best regards,
Koen
No, you cannot do that. Apple "sandboxes" apps so that they have no ability to change the behavior of other apps.
If you did find a way to do that, Apple would reject your app, and probably quickly update the OS to prevent whatever method you used to do it.
EDIT:
You might be able to find a way to do this for jailbroken devices, but obviously those can't be released to the App store.
First thing, Such Apps are not allowed to be published on App Store.
I have worked with private-apis, and i know that this is not possible with only private apis. This may be possible once after you jailbreak your phone + using private libs, and may be you can create tweaks for jailbreak to achieve this functionality.

Track usage time of all apps and power button pressing with iOS

I need to write an app that should monitor the usage time of all apps that are currently running on iOS(1).
The app should also be able to track how often the user uses the on / off button at a specific time frame (2).
Can you help me how to do this with iOS. Are there already existing open source solutions?
Thank you very much for your help.
Same as sandbox, I don't think you can do it. Apple doesn't allow monitoring other apps. If u want to do, prob have to jailbreak.

Flurry new users count

I have integrated Flurry Analytics into my iOS app. I haven't released the app yet so there can't be any real users except for myself. However, the second day I found that Flurry reports there are 5 new users. How is that possible? I did delete and rebuild my app to my phone several times for testing purpose, but according to Flurry FAQ, the same device should only be counted once. Does rebuild app from Xcode change the device id? or the hashing function of the device id?
Flurry relies on IDFV for metrics purposes. In the event that you uninstall the app and have no other apps on that device from that developer (meaning you), then the device will register as a new user.
On top of this, when submitting for distribution, Apple seems to run some automatic analysis on the app. This typically results in around 10 to 20 new users, though this effect is only observable in small apps.
I've found the same thing, I was developing with 3 devices yet according to their stats I had dozens and dozens of unique users. I wrote and politely asked what was going on and would they offer an explanation, they couldn't be bothered to reply. Same thing happened after releasing the app to the app store - the app registers with my server so I know how many users there are, yet the number reported by flurry versus the actual number differed by a huge amount. So I've come to the conclusion their figures are total bullshit.
If there's somebody from Flurry reading this please feel free to refute this and offer an explanation, if you can.

Detect which app is in foreground on iOS9 without jailbreak

I'm trying to log users individual app usage on iOS9.
I'd rather prefer that it wouldn't use jailbreak limited solutions, self explanatory. Doing the variation of this app on a jailbroken phone shouldn't be hard.
This will certainly not be released on the App Store as Apple wouldn't allow it.
I'm looking for any private API that can do this, any hidden iOS API's that can be used to do this. ANYTHING.
What I've already looked through:
how to determine which apps are background and which app is foreground on iOS by application id
How to know about app launched and details jailbreak iOS 7
Is there a private API to be able to detect what is current foreground app on iOS?
How to monitoring App running in the foreground in iOS8?use the PrivateFrameworks SpringBoardServices
which proved to be relatively helpful - we now can assume that there is some sort of additional access requirement, probably an entitlement, but we don't really know how it should look like
Can you find individual app usage duration using SpringBoard services framework or other private framework?
Find out active application or if on Springboard
Programmatically detect which iOS application is visible to user
However all of these proved to be unhelpful because Apple fixed this security flaw with iOS8 and the method to copy/access the currently front most app bundle identifier no longer works.
Question is: Is there someone who knows a workaround using different tools/exploits that do not require jailbreak?
Ideas:
inspecting the processes running on the device and devising an algorithm that would be able to recognize spikes that mean an app has been launched, which potentially could work, but it probably would be a major pain in the ass. Questions mentioning this solution:
Detect which app is currently running on iOS using sysctl,
Return a list of running background apps/processes in iOS
How to get Names of Background Running Apps
Find Background running apps in iphone
inspecting the phones traffic somehow?
not sure if there is some kernel stuff that I could do
Here is my Reddit version of this question if anyone wants to check it out. Also if it's of any value, here are the runtime headers for iOS9 and list of Apple's private API's.
Unfortunately, I was looking for a similar solution and have come to the conclusion that, at least at this point in time, there are no known methods that will allow you to determine app usage on iOS. Even the MDM providers such as Good, Airwatch, MobileIron, etc. don't seem to be able to do this. If anyone is able to come up with a solution, I'd love to see it.
For now, however, I think we would have seen a solution if someone had one that worked on the latest iOS.
sysctl is still open but they block certain combinations of selectors. I did this on iOS 7 and gave Apple Product Security the code. They won't patch iOS 7 but rely on App Review. iPhone 4 is wide open.

Is it possible to 'disable' other apps with an app of my own?

I was wondering if its possible to write an ios app that 'disables' other apps from opening?
For example, when I press the disable button on my app, I cannot open whatsapp for the next 15 minutes.
If that's not possible, could a workaround such as blocking all HTTP requests to a certain URL be possible? or even blocking (or turning off) notifications from certain apps?
I've also been wondering whether or not a security module might disallow such code..
Any help would be much appreciated!
None of the suggestion you made in your question will work on a AppStore app. Since the app is sandboxed it can not interact on the level you want with the system.
Your only possibility is to write an app for jailbroken devices.
There might be private API present as per your need but one thing is clear if you target for Apple AppStore ,it will be rejected due to its policy as aslo said by other person. Moreover ,If you still wana develop it you should go for it and there is Cydia which is a appstore for jail broken phone so you could upload your app and try to sell it off. Hope this info is useful for you.

Resources