If my tutorial help you then please donate, so that i continue writing free tutorials for every developer/programmer/freelancer
Introduction
iPhone SDK did not gives you full control over iPhone functionality. But there are few things you can do using iPhone SDK, like, you can dial a number from your application, you can open an email and SMS client from your application.
Request Full Filled
This tutorial is for Sudha who requested for this in “Request iPhone Tutorial” section (Note: any one can request for iPhone tutorial there).
Dial Number:
When you dial some number from your application then your application will go in background and in ideal state.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://123123"]];
Open Email application:
You can’t attached anything with email in SDK 2.2.1 or below. But in iPhone SDK 3.0 you can open an email client from within your application.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto:emailAdress?subject=testMail&body=its test mail."]];
Open SMS application:
You can not provide text for SMS
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:111"]];
You can grab the code from here. First select the contact from your address book and then click on bottom buttons.
[Note: If you run this code from simulator then it will not show you anything. So please install this application on your iPhone/iPod device and then test it.]
This is a guest post by Zubair Daud, an iPhone developer. Click here to find out more about him.
Popularity: 56% [?]
Related posts:
- iPhone Programming Tutorial {Part 7}: Adding Pictures into your table using Interface builder Creating iPhone Application: Introduction: I am going to write series...
- Five things you should know for building iPhone applications Five things you know before you start developing iPhone applications:...
- iPhone Programming Tutorial: Complete List of UITableView Tutorials + Videos Complete List of UITableView tutorials plus few video tutorials as...
- iPhone Programming Tutorial: Part 6: Creating custom UITableViewCell Using Interface Builder [UITableView] This tutorial will help you to create custom rows in...
- iPhone Programming Tutorial: {Part 3} Grouped UITableView I am going to write series of UITableView tutorials (Video...
Thanks a lot for the post!!!
This is so helpful.
Could you explain how the SMS works in the app? I don’t have iPhone to test the code now, using the simulator.
Thanks again!
CS Rededy
Hi Adeem,
The call and text code is not working in some phones that are upgraded to 3.0 from lower version.
Is there any limitations/changes to the code depending on the version?
Thanks,
Sudharshan
Found the problem!!
It was because we were trying to dial the number in US phone number format like (123) 456-7890.
The problem is because of the black space after braces.
Thanks,
Sudharshan
Hi Adeem,
is there any way to open the mail box from my app?
if yes, please send me some code.
Hi Adeem,
Could you please do a tutorial about youtube url implementation?
It’s very important because without i can’t continue my project.
I will be grateful you.
Sincerely,Andrea
Hi Adeem!
Nice blog!
Just wanted to tell you, that since iPhone OS 3.0b you don’t need to open the Mail app anymore, you can compose and sent mail directly from within your own app! Just use MFMailComposeViewController
- Martin