开发者

UIApplicationDelegate becomeactive with options

开发者 https://www.devze.com 2023-01-31 17:28 出处:网络
I implemented association with files in my app that works pretty great but I still have ine problem that i cannot fugire out.

I implemented association with files in my app that works pretty great but I still have ine problem that i cannot fugire out.

im my

  • (BOOL)application:(UIApplication *)开发者_高级运维application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

I have this code. it doesn't work when the app become active from background.

NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];

any suggestion how can i make this work ?

Thanks.


This method:

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

is only called when you app just launched. Coming back from background is not launching your app.

You may find these two methods useful.

- (void)applicationWillEnterForeground:(UIApplication *)application {
- (void)applicationDidBecomeActive:(UIApplication *)application {


You need to also hook with applicationDidBecomeActive: when the app became active from multitasking.

0

精彩评论

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