Monday 15 July 2013

ios - Every time my app launches (whether from cold launch or background) I want to have it do something, how do I accomplish this? -


I want to launch an app every time whether the clipboard has a URL or not, and if so, do something . Which method ignites whenever the app launches, whether it is from a cold launch (it was executed in the background for example) or if I press the Home button, copy the URL and go back.

Is this one of them? Applications: (UIApplication *) Applications - (empty) application attributes experience: (UIApplication *) application - (zero) applicationDidbackActive- (empty) applicationDiffinish Launching: (UIApplication *) Application < / Code>

is confused.

As @rmaddy, the right method to use once after launching the application ApplicationWillEnterForeground: from your App Rep. This method will be called when the user is back in the jump, but in other circumstances you do not need to answer (such as a user receiving a text message and rejecting it).

However, my test, applicationWillEnterForeground: is called not when an app starts with freezing; You must do that applicationDidFinishLaunchingWithOptions: .

So, basically, your app representative should include code like this:

  - (BOOL) Application: (UIApplication *) Application was FinishLaunchingWithOptions: (NSDictionary *) Launch Option {[self checkForURL]; ...} - (empty) applicationWellEnterbrowser: (UIApplication *) application {{self checkForURL}; ...} - (zero) checkForURL {// code for checking for URL goes here}   

Hope that helps.

No comments:

Post a Comment