How to get the name of the active app from the background app in iOS13 using Swift 5? - ios

I want to get the name of the active app from the background app in iOS13 using Swift 5. But I'm unable to find a place where such functionality is documented. Is it impossible to get it?

Is it impossible to get it?
Yes. You are sandboxed (unless you’ve jailbroken the device). You cannot learn what apps are running.

Related

watchOS Show App When Message Received [duplicate]

I know that an apple watch app can launch its parent application in the background to pass data back and forth but can it work the other way around? Can my iOS app launch the related watchOS app?
For a bit more insight, I'm trying to accomplish this so that I can monitor data periodically for the sake of notifications. The 70 seconds apple gives me to keep an app active and pulling data from healthKit isn't conducive to an app that provides alerts to users based on changes in behavior.
I apologize if this is a basic question. I'm new to watchOS development and haven't been able to find the answer to this anywhere. =/
No it cannot happen.
At the moment communication between the Watch and the Device is limited to the Watch App initialising communication with the iOS app and not the other way around.
This might help:
https://developer.apple.com/library//ios/documentation/General/Conceptual/WatchKitProgrammingGuide/SharingData.html#//apple_ref/doc/uid/TP40014969-CH29-SW1
Yes, you can. Try the startWatchApp(with:completion:) func in HealthStore. However, it can only be used in a workout app that enable the background mode of "workout processing".
Unfortunately I think I found the answer here How to programmatically open Apple Watch companion app from iOS app.
It doesn't look like it can be done. If anyone finds otherwise, let me know!

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.

Documentation for ios 7 app identifier (or whatever is called) like 6FD70F29-E007-XXXX-XXXX-XXXXXXXXXXXX

I am porting an existing Android application to iOS and I am new to iOS
The application is installed on the iOS device with this path:
/var/mobile/Applications/6FD70F29-E007-XXXX-XXXX-XXXXXXXXXXXX/myApp.app
Where the 6FD70F29-E007-XXXX-XXXX-XXXXXXXXXXXX is automatically generated by xCode.
I read a lot through the docs but I am a bit confused. How is that part called? App identifier, App ID, APP_UUID? Where is it documented? I would like to know if it changes across devices, across re-installations on the same device, after a factory reset, on app updates etc.
Thanks and sorry if it is a noob question!

How to set an image in my own app as wallpaper of lock screen in ios7?

I am building an album app. I want to set a photo in my own app as wallpaper. Is there some method available for doing so?
update:
I know there are already some similar questions posted. But they are out of time. So I am wondering if there is some method in iOS7 to implement so.
For apps going into the app store this isn't possible. Apps can't change anything outside of their environment this is because apps on iOS run in a sandboxed mode so they don't know anything about other apps that are on the device and can't affect the OS directly.
To actually do it you would probably need to use some private API so your app would get rejected under:
2.5 Apps that use non-public APIs will be rejected
but I suspect that they would actually reject it under:
10.4 Apps that create alternate desktop/home screen environments or simulate multi-App widget experiences will be rejected
As you are directly altering the home screen.

Open an application from another (iOS)

I read that there is nothing like NSWorkspace for iOS
Equivalent of NSWorkspace for iOS
Unfortunately, I wanted a button in my app that can run some others applications (in background). Is it possible without NSWorkspace ?
Your first problem is that you can't run applications in the background in the same way that you can on the Mac.
But, assuming that just launching an app is enough, the answer is: it depends. The other app would need a URL scheme defined. Not all do, unfortunately. Then you just call [UIApplication openURL:].

Resources