Sunday, October 11, 2009

iPhone dev Stupidity 48: Launching SMS



From [iPhone Developer:Tips]

"Also not supported by the iPod Touch, is the ability to quickly setup the SMS client so that your users can quickly send a text message. It is also possible to provide the body of the text message.

The format looks like this:

sms:${PHONENUMBER_OR_SHORTCODE}

NOTE: Unlike other URLs, an SMS url doesn’t use the “//” syntax. If you add these it will assume it is part of the phone number which is not.

1
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:55555"]];

NOTE: According to the official SMS specification, you should be able to send a body as well as the phone number by including “?body=” parameter on the end of the URL … unfortunately Apple doesn’t seem to support this standard."


There's also an article on Launching your app using custom URL scheme.

No comments: