Monday, 19 December 2011

IPHONE PROGRAMMING TIPS: DIALING NUMBER, OPENING EMAIL & SMS APPLICATIONS


Introduction

iPhone SDK did not gives you full control over iPhone functionality. But there are few things you can do using iPhoneSDK, 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 foriPhone 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"]];

No comments:

Post a Comment