0

I am triggering a phone call through a UIWebView, so that when the call ends, the user is returned directly to my app, via the following code:

UIWebView *callWebview = [[UIWebView alloc] init];
NSURL *telURL = [NSURL URLWithString:@"tel:number-to-call"];
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];

When it returns control back to my App I'd like to execute some code, but I am unable to determine what if any method the OS is calling when it returns to my App after the call ends? ViewWill, ViewDid etc never get called when control returns.

What if anything gets called when the call ends and control returns to the webview/app?

Speckpgh
  • 3,332
  • 1
  • 28
  • 46

1 Answers1

0

UIWebview Class has some delegate founctions.webview call these founctions when start loading and finish loading request and so on. I have poor English,I wish you can understand me.if I misread your question and my answer isn't what you want,please forgive me.

mengxiangjian
  • 552
  • 2
  • 8
  • Yes, I understand the webview has delegate functions, but I am not loading a page, I am using a kludge. Basically Apple in their wisdom doesn't return to your app after you instantiate a phone call from it if you use the normal [UIApplication sharedApplicatio] openUrl:... calls. This will start a call programatically, but when the user ends the call they are not returned to your app. So, you can get iOS to return to your app, if you open a tel:// url from within a webview. If you do this, when the user ends the call they are directly returned to your app. – Speckpgh Apr 13 '12 at 12:31
  • Which is the behavior I want, but Upon returning to my app, I assume some delegate method would get called, but none (on the view at least) do. I will investigate if the application delegates get called, and may have to see if I can use the phone state notifications to accomplish this. – Speckpgh Apr 13 '12 at 12:33
  • Followup. There are certain Application Level Delegate Methods that do get called as part of this kludge loop, that can be utilized to do what I need, but I am not having issues where it appears, objects are being removed from memory and recreated in this stack and while they get recreated by iOS the timing of the app delegate methods is prior to the recreations events and no events are trigged by them. – Speckpgh Apr 18 '12 at 15:40