Vishal Kardode
Vishal Kardode

Reputation: 971

callback url for tel:

I am using tel:{phone-number} to initiate call from my application.

I want to know if I can set a callback url for my application, so that once the call ends My Application starts (resumes) again.

Upvotes: 0

Views: 166

Answers (1)

David Jones - iPushPull
David Jones - iPushPull

Reputation: 2879

Not sure about using a callback, but you can use a UIWebView to make a call without leaving your app. In this case escapedPhoneNumber is an NSString containing the number you want to call:

NSURL *telURL = 
[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", 
                        escapedPhoneNumber]];

// using a UIWebView here allows us to make a call without leaving the App
UIWebView * callWebview = [[UIWebView alloc] init];
[self.view addSubview:callWebview];
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];

Upvotes: 2

Related Questions