开发者

Launching app in background in iPhone

Is there a way that I can use the url scheme approach to launch an application in the b开发者_开发技巧ackground or if it is already running in the background invoke it without it (the callee) coming to the foreground? I heard that this can be done in iOS 4.2 but don't see it when I use

[[UIApplication sharedApplication] openURL:url];

to open the application. Thanks, N.


It does not look like it is possible.

If your application is not running when a URL request arrives, it is launched and moved to the foreground so that it can open the URL. The implementation of your application:didFinishLaunchingWithOptions: method should retrieve the URL from its options dictionary and determine whether the application can open it. If it can, return YES and let your application:openURL:sourceApplication:annotation: or application:handleOpenURL: method handle the actual opening of the URL.

If your application is running but is in the background or suspended, it is moved to the foreground to open the URL. Shortly thereafter, the system calls the delegate’s application:openURL:sourceApplication:annotation: to check the URL and open it. If your delegate does not implement this method (or the current system version is iOS 4.1 or earlier), the system calls your delegate’s application:handleOpenURL: method instead.

iOS Application Programming Guide

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜