Get content of SMS and email in iPhone?

可紊 提交于 2019-12-24 07:18:12

问题


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...


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3207919/get-content-of-sms-and-email-in-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!