To Create Software to Access SMS Backup on iPhone - iphone

I have a crazy idea. I have read that accessing SMS messages from code for iPhone is impossible.
But is there a way to bypass this? I would like to write a piece of software which accesses user's SMS messages and shows some analytics.
I have read that it is possible for iPhone user to make SMS backups.
And here my question comes: can a user somehow set automatic SMS backup to somewhere (e.g. iCloud or Desktop), so that I can write software which will automatically read that backup and show some analytics?
Let's assume that the iPhone user doesn't mind to give my software access to his SMS messages backup.

Apple uses a technique called sandboxing. An app can only access it's own files. Your app can only access it's files in it's own application directory. The SMS database is not in your apps directory. The SMS messages cannot be accessed on a non-jailbroken phone. (Apple is getting better at protecting against jailbreaks).

Related

An Iphone App to access SMS and store it on iCloud

Is it possible to write an Iphone App that can access the SMS Messages on the Phone and store it elsewhere? I have seen other questions like this and another question that says one can send SMS with the MFMessageComposeViewController from the MessageUI Framework.
Since both the questions were more than a year old, is it possible to do this now ( Accessing SMS messages and storing it on the iCloud) ?
No this is not possible, the iOS SDK does not allow you to access the messages from the messages.app.
Also all message are already backed up to iCloud when a device backup is made.
The Apple Dev Library says, "In iOS 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." I wish they would explain why they won't allow programs to access messages.
So not with an iPhone app, apparently, but you can access them with a desktop app. See http://www.wired.com/2013/11/backup-sms-iphone:
"Apple saves your text messages in its iPhone backups, whether they’re saved locally on your PC or whether they’re part of an iCloud backup — which you should have. That’s good! Unfortunately, they’re not separated out. However, you can access them through the filesystem. If you back up locally on an Apple machine, you can find the file under Library > Application Support > MobileSync > Backup. There should be multiple folders there, each with a different backup image of your phone. Each of the folders should have a file named ” 3d0d7e5fb2ce288813306e4d4636395e047a3d28.mddata.” Those are your texts, in SQLite database form."
You'll need to use SQLite to decipher the file. There are some instructions here:
How to Access and Read the iPhone SMS Text Message Backup Files.

to get sms stats in application

In my application I want to get the total number of SMS sent from iPhone. My application is targeted for cydia store for jail broken devices and Currently I am working on xcode 4.5.2 and iOS 6.
When the application opens I want to get the total SMS sent from iPhone message log. Can we get total SMS sent on a particular day. I saw some applications in cydia store which maintains SMS history logs for example"SMS Stats", "SMS Counter". Is there any third party framework to get sms count?. I had searched in many ways but I found no solution. Please help me.
The messages are kept in a SQLite database called sms.db
You can make queries on it to collect the information you want.
At theiphonewiki got some information about the DB but I am not sure it is updated to iOS 6, you might just have to investigate the DB using some SQLite explorer to figure out what you need.

Want to transfer data on iPhone to a program on a PC

I have an iPhone app that reads barcodes. I want to transfer that data to a program I have written on my PC. Is this possible?
The easiest way to do this is to have a web server which the app transfers the barcode to and the application on the computer grabs it from. You could probably have each user make an account which they log in to on both the phone and the computer.
EDIT: This document: http://developer.apple.com/library/ios/#technotes/tn2152/_index.html describes various methods for transferring data between an iphone and a computer.
This is just a suggestion, haven't tried it myself: You can use the iTunes filesharing feature Apple introduced for iOS. This seems to be a good tutorial on how to use it in your App http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app
The only thing is that it requires the user to import/export the files to share on their own via iTunes, if you're cool with that it sounds like a good strategy to use built-in features of iOS.

Get content of SMS and email in iPhone?

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

iPhone: Need suggestion for SYNC contact

i want to create a application which sync my iPhone contacts to my server and vice-versa.
i read a article on google Get Google Sync on your phone . i want to this type of feature which directly update the contact without user interaction (however one time setting is desired).
any body have idea how the google sync work .
Please advice me that how can i achieve this task. any suggestion and link is greatly appreciated
I think it's important to separate the two overlapping approaches in your question.
Firstly, Google Sync is essentially a way to use Microsoft Exchange protocols and to setup a Mail / Contact / Calendar profile on an iPhone. The iPhone OS supports this feature, not an iPhone App in the App Store. Google Sync leverages this fundamental capability of the phone by exposing the data (mail, contacts, calendars) via these known protocols. If you want to expose data in this way to your users, setup a Microsoft Exchange server and ask questions on serverfault.
Secondly, there are iPhone apps. iPhone apps sold in the app store are not currently allowed to run in the background. This means you can't emulate functionality like iTunes or Mail where your music plays while you are browsing the web, or mail checking is done while you are playing a game of Mini Squadron. If you want this backgrounding capability, file a bug/enhancement with Apple.. However, you can interact with iPhone contacts (Address Book) via the API.. You can also of course "re-invent the wheel" and expose the data however you like via the internet, and consume that data from a custom iPhone App with the one caveat that users would need to actively launch your application to get to this data and it would not be integrated with the built-in iPhone Calendar, Address Book or Mail applications. Some good examples of that are some of the music community apps that have messaging systems built into them. Presumably that is all being done with web services.
EDIT: It is also worth mentioning that should you go the "iPhone App" route, you should at least consider if push notifications are right for you, and if so how you will handle it.
Have you seen the API-Docs?
http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/100-Introduction/Introduction.html
Next there is an application I use called Funambol - it is a sync4j Server/Client. They have an open source application to sync contacts on the iPhone. Source is somewhere in their repository, informations here: http://forge.ow2.org/scm/?group_id=96
As slf told you your application must run in foreground. This may limit you.
Good luck & best regards,
Florian
The 3.0 SDK will allow your application to read contact data on the phone.
Web services will allow you to publish that data to your server, and receive updates.
You may also want to use coredata to store a hash of all contact data so you can tell what is new / updated and just send that data to your server.