title: Delegate to know when phone call ends which was initiated by app
body: <p>I have a code which places a phone call using below code : </p>
  
  <pre><code>// Make a call to given phone number
  - (void)callPhoneNumber:(NSString *)phoneNumber
  {
      if (!self.webview)
          self.webview = [[UIWebView alloc] init];
      self.webview.delegate = self;
  
      // Remove non-digits from phone number
      phoneNumber = [[phoneNumber componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
  
      // Make a call
      NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", phoneNumber]];
      [self.webview loadRequest:[NSURLRequest requestWithURL:url]];
      [self.view addSubview:self.webview];
  }
  </code></pre>
  
  <p>This makes a call. What I want is, <em>I want to know when user ends a call</em>. I have to perform an operation when user ends a call. Is there any way for it?</p>
  
  <p>What I tried is, I set delegate of <code>webview</code> to current controller. But none of the delegate methods is called.</p>
  
  <pre><code>- (void)webViewDidStartLoad:(UIWebView *)webView
  {
      DLog(@"Start Loading");
  }
  
  - (void)webViewDidFinishLoad:(UIWebView *)webView
  {
      DLog(@"Finish Loading");
  }
  
  - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
  {
      DLog(@"Did fail with error : %@", error);
  }
  </code></pre>
  
  <p>I don't know if you need this info but I use webview so that when phone call is made, flow remains within the app and on call end, app screen is displayed rather than user manually coming to app from native contact app.</p>