Sunday, 30 October 2011

iPhone Development:Dial a number from iphone application










Want to allow user to make a phone call direct from app OR want to open a link direct in safari app of your iPhone,iPod and iPad devices.We can do this by writing off just a single line of code.Below is the code snippet that will made a phone call direct from your application
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18008294222"]];
Note: This will take control out of the app and app will not open when user end the call.


To open a link or your website in a safari app of your iPhone, you can use the below code snippet
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com"]];

Note: This will take control out of the app.

No comments:
Write comments