I’m trying to initiate a call from within an iPhone app.
This related code works and opens Safari as expected:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.apple.com"]];
But, when I replace the http URL with a tel URL the resulting code does not invoke the phone app:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:3035551212"]];
No exceptions or alerts are generated (in the simulator or on a device).
Any idea what the problem might be with my invocation?
Thanks.
The iphone will dial a number using either of the formats listed below. But, it will do nothing if you are in the simulator. It took me 30 minutes of banging my head to figure this out.
Link for Apple documentation on the tel: url scheme
Link for openURL documentation