Search code examples
iosobjective-cuiapplicationdelegate

How do I tell if app has been opened without URL?


I know I can check if a URL has been used to open my application, like so:

- (BOOL)application:(UIApplication*)application
          openURL:(NSURL*)url
sourceApplication:(NSString*)sourceApplication
       annotation:(id)annotation'

... but how do I check if the user has only returned to the app (and update my interface accordingly), without a URL being used? The use case is when logging in to Facebook or Twitter via Safari, and then user just goes back to the app instead.


Solution

  • Use applicationDidBecomeActive or applicationWillEnterForeground