1

I'm trying to implement an app that can read received SMS and email out. I mean convert the text content to voice. So I need to access to SMS and email first. As far as I know, there is no such API provided in the default SDK. Is there any other way to realize it? Are the SMS messages stored in database(sms.db)? How to access to them? Is it only possible on jailbroken iphones? And what about emails? Are they only stored in mail servers? How can I get them in my app?

Sorry for asking so many questions. I have spent many days on this problem, but havn't found any solutions...

smilexx
  • 11
  • 1
  • 2
  • Don't think this is currently possible on non-jailbroken phones. Here's a related question: http://stackoverflow.com/questions/387934/iphone-how-to-programmatically-respond-to-sms-messages – Avalanchis Jul 08 '10 at 20:55
  • Thank you for the link. So it is possible on jailbroken iPhones? – smilexx Jul 08 '10 at 23:04

2 Answers2

5

You can't. According to the Device Features Programming Guide: Sending an SMS Message:

In iPhone OS 4.0 and later, you can send text messages from within your application. This feature is strictly for sending messages. Incoming SMS messages go to the built-in Messages app.

There are serious privacy and security concerns with enabling app access to emails and SMS, and I am glad Apple choose not to do it.

Franci Penov
  • 74,861
  • 18
  • 132
  • 169
  • I understand that. It is indeed dangerous to enable app to access to emails and SMS. But I just want to read them, nothing vicious. I don't need it to be in app store, either. Just a project for school. Hoping there are some solutions... – smilexx Jul 08 '10 at 23:18
  • 3
    There's no way for Apple to enable that functionality for "good" apps and disable it for "bad" ones. Even if there was an IAmGoodAppIPromise API that unlocks it, the OS can't trust that only good apps will call that API. Thus, if the "read SMS" feature is there, it's inherently available for both good and bad apps. :-) – Franci Penov Jul 08 '10 at 23:59
0

Yes, you can, (at least with SMS) but only in a jailbreak app (which you suggest is ok in your comments).

The sms.db file can be read by apps that aren't sandboxed.

See my answer to a similar question for how to get SMS content. That answer just shows how to get the most recent SMS, but if you just use the commented out while loop, you can iterate through all SMS.

Community
  • 1
  • 1
Nate
  • 31,017
  • 13
  • 83
  • 207