2
votes

I'm a Java/Web developer and I don't know anything about iPhone applications.

I did search on the Internet and the following steps are what I think people suggested but I want to confirm.

I would like to know if the following steps will allow me to send a content body to SMS messages when a user clicks on a link on a web page.

  1. Build an iPhone app that takes content body and receiver phone number.
  2. Make the visitors to my webpage download the iPhone app in #1 (using javascript to check if s/he already has it and a custom url scheme to open the iPhone version of "PlayStore")
  3. The visitor installs the app.
  4. Call the iPhone app in #1 using a custom URL scheme, from a link on a web page. This link contains the phone number of the receiver and a content body
  5. The iPhone app in #1 then opens the native SMS app in iPhone, this time with a body.


Is this
1. possible ?
2. the right way to do ?
EDIT :

To make things clearer, what I need are...

  1. It shouldn't be the web server that sends the SMS. The client who gave us the job does not want to pay for that. The client wants each visitor send their own SMS and pay for it.
  2. I made a mistake. The phone number of the receiver should be empty. Only the content body is pre populated. So if I clicked on the "send SMS to my friends" link(on a webpage), it opens the native SMS application.(at least, this is how it works on android devices currently). And then the visitor would type in or select the phone number of the receiver from the contacts on his device.
3

3 Answers

2
votes

No, you cannot open the SMS app with a message body. The only way to send it is by using MFMessageComposeViewController (iOS 5.0+) as shown in this page. If you need to support earlier versions, you are out of luck.

I'm not sure that Javascript can "check" that the device can run a url scheme either (I'm almost certain it can't check what apps are installed), but I'm not an expert at that kind of stuff.

1
votes

As far as you are launching your application with some data using Custom URL Schemes this might help you calling your app with some parameters

http://www.idev101.com/code/Objective-C/custom_url_schemes.html

For step #5 its not possible

0
votes

Short Answers:

  1. No.
  2. No. The "right" version would be to send the SMS from your webserver, using something like NowSMS.