views:

49

answers:

0

I have an app that can be started up by clicking a link from outside the app. Before iOS 4 this worked fine. But now that you have to implement applicationWillEnterForeground, I'm having problems. The problem I have is going from this method to the handleOpenURL method.

I have no problems when didFinishLaunchingWithOptions is called because I handle the url there. But when my app goes into the background, then comes into the foreground, it appears that didFinishLaunchingWithOptions is not being called, or at least not completely. I say not completely because the splash screen comes up and you are taken to the home screen, but this logic only exists inside didFinishLaunchingWithOptions so I'm not sure how the splash page comes up without didFinishLaunchingWithOptions firing. However, the url logic does not fire when the app resumes, and this is also in didFinishLaunchingWithOptions.

I assume this is where I need to use applicationWillEnterForeground, but this method has not options parameter, so how do I get the url and pass it along to - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url

All I'm really trying to do is have my app launch from a link after it becomes inactive the way it does when it first launches. I have not implemented applicationWillEnterForeground because I'm not sure what to do with it. All it really needs to do is handle the url.