title: AppDelegate feature in UIViewcontroller
body: <p>I have a viewcontroller that has code to implement the Facebook window. the problem is that to run the code, I need this url:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   sourceApplication:(NSString *)sourceApplication
  annotation:(id)annotation {
  // attempt to extract a token from the url
   self.openedURL = url;
  // attempt to extract a token from the url
   return [FBSession.activeSession handleOpenURL:url];       
   }
  </code></pre>
  
  <p>...and as I have understood it can only be run in the app delegate, but I need it to get the url. If I simply add it to the delegate it is not called, and I don't know when it is called and how. any suggestions??</p>