Data Exchange between same iPhone App on separate devices - iphone

I am developing an app on iphone that lets user take photos, add comments & GPS location to it and send it as an email to another user.
If the recipient has installed the same app & when she clicks on the attachment the same app will launch & parse these details & show them to the recipient. (I intend to use UIDocumentInteractionController for some of the stuff here)
Problem: whats the best way to encode this data in a single file & then retrive it upon arrival from the email.

This is pretty high level, but here are the general steps:
First, register your own file type as described here.
Then, archive your data using NSKeyedArchiver.
Next, attach it to an email using MFMailComposeViewController. Make sure you give it a filename that matches the file type you registered earlier.
Finally, implement application:didFinishLaunchingWithOptions: to handle the case when a user tries to open your email attachment. (Currently, it's the fourth bullet in the method documentation.)

Related

iOS app to take photo and send to specified email address with unique ID

I am fairly new to iOS app developemt but I am doing some research on behalf of a client who wants to create a native or hybrid iOS app that allows users to take a photo using their iPhone camera and proceed to automatically send that picture (upon confirmation by user), with a unique identifier attached to the email, to a predetermined email address. Is this reasonably straightforward? Are there any privacy issues that need to be addressed when sending this type of data?
Also, how would that user be identified so that the relevant response can be sent back to them? Basically, what happens is the photo of the product is received and that product is manually sourced from a chain of partner merchants. Then, the prices and merchant details are sent back to the user. How might this work on iOS?
Many thanks, sorry if this sounds too vague but just ask for more details.
You can Use PHP for backend For Uploading the image in server and Generating a unique code for each pictures uploaded by user.
So the process is like iPhone -->upload.php -->get the response link from php and mail that link to specified

Access Local SMS Data in the Application in iphone

I want to access all of the message text body so I can store it in some file.
Like I have stored the address book in csv file and when I press the restore button at that time particular csv data I set in the address book.
Is it possible in iPhone to access that way SMS data in the application?
You can't, there is no public API for accessing the message app.

How to pass the senders email address when opening an attachment in your app

I'm trying to make an app that opens a certain file type when attached to emails.
I know how to get the file path which is passed when the app is launched, but is it possible to also have the sender's email address and subject passed to the app also? Is it already part of the dictionary that is passed in didFinishLaunchingWithOptions:?
You don't even need to log the dictionary: it's all in the Apple documentation (right here, you're after 'launch options keys')
I am doubtful what you want can be achieved I'm afraid.

How to run my programm to process email attachment of specified type on iPhone OS

I need to run my iPhone application when user gets email with attachment of specified type and process it. For example "some.jpg". How?
You're not going to be able to take over a basic file type like this on the iPhone. The closest you can come is to implement your own custom URL scheme, which would let you have your application be launched in the same sorts of circumstances if you're the one sending the email...
What this means is that you could make it so an email link like
myspecialimage://mycoolserver.com/some.jpg
launches your special application when a user clicks in.
See this link or the Apple documentation for guidance.

iPhone programming: Sending data from one iPhone to another?

I am new to iPhone development. I created an iPhone application, using which user can create a Business Card kind of UI in TableView. I want to know how can i send a Business Card(which i created programmatically) data into another iPhone via SMS? I want to know the technology which i should use to sending such thing from one iPhone to another via SMS or Email, i shouldn't use WiFi/Bonjour service which can send only upto nearest area.
thanks.
Calve/
SMS wasn't designed for this, and so it probably won't work like you're describing. Here's what I would do:
You have your BusinessCard object. Upload it to your servers and give it a unique identifier. This identifier is what should be sent to the other person, whereupon they can use the identifier to download the appropriate card.
If you wanted to be super cool about it, you could maybe construct a URL like: "card://12345678890", where 1234567890 is the identifier. You could then set your app up to respond to "card://" urls. Then send the card URL around via SMS. When a user taps on the link in their SMS app, it'll automatically open up your app (providing that they have it downloaded and installed, and that nothing else has registered "card://").
For additional awesomeness, you can allow people to create "shortcuts" to their identifier (like bit.ly), so they can send around "card://my-cool-business" instead of "card://1234567890".
You could encode your business card data as a base64-encoded custom URL, assuming it isn't too large. An example of doing this kind of URL-driven data exchange (which does not require uploading anything to a server) can be found here.
I doubt that you'll be able to encode enough information in the tiny size of an SMS message (unless you were just sending compressed text, no images), but this approach would work well with email.
Where MMS is available you can send a VCard formatted object attachment by that route. The receiving phone will detect the attachment format and allow you to manipulate it.
This will also work to non iPhone devices.