Is there a way to detect the running app, while my app is in the background in ios? - iphone

I need to detect the running application when my ios app is in the background. Basically I need to know if the user launched the Safari app?
Is there any way to do this? as I know when an app is in background, it may suspended or it could do only a minimal of things. Any help is very much appreciated.

you can only detect if your app is going to the background, no info is available regarding others apps.

One caveat is that within your app, you can test for another app being available:
- (BOOL)canOpenURL:(NSURL *)url
This can tell you whether the current device has a specific application installed IF that application is setup to handle url schemes for launching from another app.
Apple's Docs

No, there is no such way. Anything you're trying to know outside the scope of your app is forbidden by Apple.

Related

Access the Apps available in iphone

Hi i would like to access the apps which are available in iphone means downloaded apps and inbuild apps.But here issue is if i access any app which is available in iphone using [[UIapplication sharedapplication]openurl:[NSURl url urlwithstring:#"http://www.skype.com"]] like this i can able to access that iphone app succesfully but if i want to come back to my app i did not find any way only i have to hit homebutton. So is there anyway to come back to my app at any point of time. if anyone know please let me know. Thanking you.
So is there anyway to come back to my app at any point of time.
Not unless the other app supports returning back to the calling app (by responding to a special specifier in the URL, for example).
Note that there is also -[UIApplication canOpenURL:] which will tell you if a particular URL scheme is supported. This is useful to check whether a particular app is installed without attempting to launch it.
That is default behavior of the iOS application. Once your application is in background there is no way to come back to your application programatically.
User has to manually open your application.
You can navigate to some other apps on the phone using the URL method, however you cannot return to your app.
Once you navigate to the other app, it takes over and your app is no longer running. Therefore, the other app would need to navigate back to you. That obviously is not possible, unless you had access to the code of the other app.

Iphone Lock Screen

friends, I am new to Iphone development, I am creating a simple analog clock, infact I have already created one ( i am basically an Android Developer - created same as widget for android too), Iphone does not seem to support widgets, but I was wondering if it is possible to create a lock screen app or something (i.e. when screen locks iphone shows a clock) is it possible that my clock replace the iphone one, any ideas , thanks in advance
It is impossible to replace the lock screen of iOS devices with a custom one. iOS apps are not allowed to "lock" the system by any means. Can't avoid the user pressing the home button.
No it is not possible. There is no public API for the lock screen.
Although you may be able to find a way to accomplish your goal in development, it will almost assuredly be rejected by Apple. Here is an excerpt from the App Store Review Guidelines
10.4 Apps that create alternate desktop/home screen environments or simulate multi-app widget experiences will be rejected
It is 100% possible but not approved by Apple. You can develop an app but will never be part of the app store... You can however use it for personal use or share it through a Cydia repo (jailbroken devices). But it is possible.
Not sure with all of you, although i agree a long time ago.. I Just browsing the app store and found an application that can change the way user unlock the iphone after it lock.. Here's the app "Slide your phone"

iPhone - app which can not be killed

I am trying to understand, is there any way to develop iPhone app with following conditions:
1) This application should always run in the background
2) This application should not be killable
3) With out JailBreak?
All I am trying to do is want to track my iPhone.
Please help me.
Thanks
It's not clear exactly what you want to do, but one of the cases where Apple allows apps to run in the background is so that they can respond to changes in the GPS location. It's not unkillable per se, but apps do relaunch automatically (I think) if they're killed due to low memory, etc.
See here for the Apple docs.
No, this is not possible unless you are Apple.
No. I'm pretty sure attempting this is going to get your app rejected (if its even possible!). The iOS system has its own ways of managing running applications and will kill apps if certain conditions are met (e.g. unresponsive for a while).
Check out the App State & Multitasking doc.
Your requirements are:
1) This application should always run in the background
2) This application should not be killable
3) With out JailBreak?
Answer:
I think there is no Non-Apple app which has all the three features. I think even one of these feature is nearly not possible.
Also if you say that Photos and Phone and others like Newsstand cannot be deleted, then you need to consider that those are apps of Apple and they have some more capabilities than what they give in Public API's to the developers.
They have some greater access to the iOS and many of its private API's which make them non-deletable.
Hope this helps you.
If you don't plan to release it to AppStore, but rather will sign with enterprise distribution certificate and will use it in your enterprise then you can look at VOIP application for iOS. It runs in the background, system restarts it automatically. I think that's the closest you can get on non jailbroken device.

Question on running iPad application

I would like to know that, is it possible to run iPad application in the start up of iPad device ? also apple approves that kind app?
Please help me out, wherever i search i cant find firm answers.
Thanks for any insights!
You mean automatically run an app of your choice when a user turns on an iPad? Like a startup app?
No, that is not possible. It is only possible to run an app when a user taps on the app icon on the launch screen.

how to run application in background in iphone?

i have implemented one application.I want to run this application in iphone background(not client server base).How it possible.Please help me.
Thanks in advance.
Can't without jailbreaking. Apple does not let you run apps in the background. You can use Push Notifications to accomplish a lot of use cases for background programming, but the simple fact is you can't have a background process.
You can't. See http://gizmodo.com/5256821/rumor-apple-considering-iphone-background-apps
Apple doesn't let third party applications run in the background. I do hope they change that feature soon!
You can register your app to use gps/voip services and it will run in background!
One thing to be noted is such apps will be rejected from appstore unless there is really gps needed within the app for navigation.