I develop apps for jailbroken phones, and I need my app to be backgrounded and to be able to keep running as usual when backgrounded.
On iOS3.0, I would just block the thread at applicationWillTerminate, and that'd be it. But it seems that the fast app switching method in 4.0 is disabling applicationWillTerminate, so I can't use that anymore.
I've tried overriding applicationSuspend by calling it, but that doesn't appear to work either.
Do you guys have any idea how to do this?
Thanks
Maybe you need to intercept the new methods triggering the quasi-backgrounding process set by Apple.
-(void)applicationWillResignActive
-(void)applicationDidEnterBackground
-(void)applicatonWillEnterForeground
-(void)applicationDidBecomeActive
Related
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.
Is it possible to write application via cydia to run in background like appsyn? Work with jailbreak device.
Without Backgrounder(Cydia)
Or is it possible to hide icon form springboard and hide arrow(Corelocation)?
i want to run my app like run plist in background.
please help me
Thank(Advance)
Yes, it is possible. In fact, I originally wrote Backgrounder for exactly this purpose; to act as a model for others to use.
You must do two things:
Make certain that you app installs to /Applications/ (and not /var/mobile/Applications).
Create your own UIApplication subclass, and add the following method:
- (void)applicationSuspend {} // Do nothing
However, if you are targetting iOS 4.0 or newer, you should consider using one of Apple's provided multitasking methods.
Also, depending on what you are developing, it might be wiser to create a daemon (or daemon/client) instead.
I would like to be able to make a call from within my application, but have it start in the background using the new features in iOS 4.0. I tried using the following code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel://09650159343"]]]
but this causes a call to be made in the foreground, terminating my application. Is is possible to make a call and have it start in the background?
I'm sorry to tell you that this will never ever work, at least not on a non-jailbroken device.
Even on a jailbroke device this won't work the way you approach the problem. opening an url will always opens the associated application to handle it.
before iOS4 this terminated the application, but now with fast app switching this should make the app in the background if you ask me. But it doesn't, this was forgotten on apple's to do list for iOS4?
I have not had much time to read through all the documentation for the 1500 more features included in iOS4, so right now I have 2 questions:
If the app is just a usual utility application, what to do to make it "qualified on iOS 4"?
If the app uses a timer to refresh all the items on the screen every one minute (requires redrawing of the sub views), what are the changes that have to be done? ( I notice that even though when I quit the application, open it again in a 3GS iPhone, the timer is still generating events).
Update
What I want is the technical part of the story, not the description on the appstore, etc...
E.s. Those applications above have to do something with applicationWillResignActive, applicationDidEnterBackground, applicationWillEnterForeground, applicationDidBecomeActive, etc...
This is something that Apple do when testing your app after you submit it via iTunes Connect.
They will test your app on iOS4 and if they decide it works sufficiently, they'll mark it as tested on iOS4.
If, for whatever reason, it doesn't work well on iOS4, they'll reject the app and let you know what was wrong.
It's a label given automatically by Apple after they test it on iOS4. You may not actually need to do anything extra to get it.
I'd like to run an app in the KIOSK mode, so that it
auto-starts after starting the device
re-starts after app crash/power loss/etc.
Any ideas how to do this on a [probably jailbroken?] iPhone?
The easiest method would be to create a mobilesubstrate extension that runs inside SpringBoard and throws up its own UIWindow.
Create a static __attribute__((constructor)) function and inside register for UIApplicationDidFinishLaunchingNotification. After receiving the notification, 99% of the standard iPhone SDK will work as-is.
It will have to be jailbroken because the standard OS won't give you that level of control.
Since you are already thinking jailbreak, perhaps look into launchd on the phone as whatever starts up Springboard could also probably be made to start up your app after.