开发者

Load the iphone app automatically when phone boots

I am doing a tracking kind of application for internal use of an organization and do not wish to submit it to app store.

What I am doing in the application is I am tracking the phone calls, messages etc.

My app runs in background once I start the app manually and keeps on running in the background until I close the app or the phone is switched off.

The thing that I want to add to my app is, I want to load the app automatically when the phone is switched on again.

Any idea or guidance will help开发者_如何转开发. Suggestion for use of private apis is also welcome.


In private api, in file SBApplication.h there are all methods that you need.

In particular:

[...]
-(BOOL) _shouldAutoLaunchOnBoot:(BOOL)boot;
-(void) autoLaunchIfNecessaryOnBoot:(BOOL)boot;
-(void) _cancelAutoRelaunch;
-(void) _relaunchAfterExit;
[...]

etc, etc...

hope this helps.


As far as I can understand you can do it by registering your app for significant location changes. If an app registers for significant location changes, as soon as your cellular phone moves to a new tower, app receives an update. If the application is suspended when an update occurs, the system wakes it up in the background to handle the update.

So if you close the app and turn of your phone, as soon as your phone will restart it should get an update and it will force your app to run in background mode.

For more info read iOS programming guide: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html

Hope it helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜