I understand that your application is sandboxed in Apple environment. But I have a need to know the application that user currently is playing with - just the name is enough in my application which is currently in background.
Is there any possibility to know the application name which is currently in foreground?
Please do not down vote. My intention is to check if somebody has used some private API in the past to do this.
Related
My iOS application (using Swift) needs to react to a user having opened another application. It does not necessarily need to know what app it is. It just needs to know that the app being opened is not the phone call/dialer app, because the dialer app would be the only app that receives an exception from my application. I do not want to stop the user from opening the other apps, but just have my app react to that action.
I know it is possible, because there is an app on the app store that uses this functionality currently. The app I am referring to is called Forest- Stay Focused. It seems like I should be able to use the AppDelegate functions somehow, but I cannot seem to figure out how.
How can I accomplish what I am looking to do?
Is there a way to run ios application code unlimited/ long time while the user terminate my app from background? Please help me.
I have searched a lot but did not find any proper solution.
No this is not possible.
There are a bunch of services that you can run in the background such as Location Services BUT even for that you need to configure your app and have the CONSENT of the END USER to continue to monitor his/her location. Even if the user consents, he has a bunch of options like monitor my location while using the app or always or never.
All these options are something that user can change in the "Settings" section of the iOS device.
Even if you try to run your app or any of the services background without the consent of the End user, Apple will definitely reject your app.
Hope this helps.
In my app, Can I check that which app is being used by a user right now, while my app is running in background?
If so, Is there any API available to get that info?
thanks in advance!
No. There's no public API that lets you a background app find out about the foreground app, or get a list of running apps, or anything like that.
The only mechanism for finding out about other apps on the device is +[UIApplication canOpenURL:], which you can use in some cases to find out whether a specific custom URL scheme can be handled. From that you can often guess that a particular app is installed, although the method really only tells you that some app that can handle the given scheme is installed. However, you still can't find out if that app is the foreground app, or even if it's running at all.
Is there any possible way to track which application is running in foreground in device in iOS.
For example if I am using facebook app I need to get the name of the application from my application.
If SMS application is used I need to get the name of the application from my application.
It's not possible. All you can do is get a list of currently running tasks using a systcl call.
Assuming the user has not launched your app yet, but it has been run before. Is there a way to still "push" news/updates?
To explain what I mean:
Imagine the user installed "your-restaurants-in-your-area" local orientated app, and configured the app in some setting to notify the user when new restaurants open... However, the user forgets to run this app at a daily basis. Is there a way for the app to auto-show news inside iOS?
I have found this for XE4 where Anders is stying to help people get it working with XE4
http://blogs.embarcadero.com/ao/2013/05/02/39456
http://blogs.embarcadero.com/ao/2013/05/24/39472
After further searching (I missed this first round) I found this:
http://edn.embarcadero.com/article/43239
It requires editing Delphi XE4 bundled source files (i.e. so it is not officially supported / made easy in XE4), but it seems it can be made to work. (I have not found any official mention of official "built-in" support in XE5.)
I upvoted the answer given sofar since it was helpful in a way.
The question is not related to Delphi…
It is impossible to auto-run/unattended-run applications in iOS.
If the user has never opened your application, you will not able to send him “Push notification”, because your application must be registered with the token. Usually the application registers on the start.
Let’s assume the user launched the application at least once, and your application successfully registered the token for “Push notification”. In this situation, you will able to notify the user when the new restaurant will be opened.
The problem in this situation that you don’t know the physical location of the user. Maybe you can add the region of interests in your applications, so you will know to whom to send the notification.