Razgriz
Razgriz

Reputation: 7343

Opening app from sms and getting the sms contents in iOS

I am trying to build an iOS application. The basic premise is that the user receives an SMS which has a message, a link to the application, and other details. For example, the message might look like this:

Good morning! Kindly open the application: mylink://here
Additional Info: 123123
Additional Info: 321321

I know that if the user has installed my application, he or she will be able to click the mylink://here and it will open my application. Answers in this question discuss said topic thoroughly. My concern mainly has something thing to do with fetching the additional information from the text message. My application will need the additional informations in the SMS and is there a way to fetch the additional information without having to programmatically go through them in my application?

Since the application is opened via SMS, is there a provision in iOS that provides your application, if opened by an SMS, with the raw SMS text?

I'm a bit new in iOS development and I'm mostly relying on what I am able to research online. As much as possible I do not want to fetch the SMSs (if iOS even allows that), find the one I'm looking for, then parse from there.

Upvotes: 4

Views: 1931

Answers (2)

Oxcug
Oxcug

Reputation: 6604

Well you can't read or send sms messages... At all. That's a big no-no in standard iOS. However, you could pass some simplified info via url scheme. It could look something like this:

myappscheme://www.someurl.com?flag=true&myotherinfo=hi

You'll want to read more about it here: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html

Upvotes: 3

Moin Shirazi
Moin Shirazi

Reputation: 4425

Sorry from Apple side but can't access these on a standard, non-jailbroken iPhone. You should file a bug with Apple, perhaps they'll improve SMS access in the future.

Not possible Check this https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMessageComposeViewController_class/index.html

For SMS sending through application allowed but for accessing inbox for sms/email not allowed.

It is only possible when the phone is Jailbreaked. There are many tools to jailbreak your phone.

Once Jailbreaked, an application cal open the SQLite database at

/var/mobile/Library/SMS/sms.db and read the message table.

It contains, the date/time at which the message was received, the sender/recipient phone number and even the clear text of the message.

Refer this Question to read content of sms: Read SMS message in iOS

Upvotes: 1

Related Questions