iPhone programming: Sending data from one iPhone to another? - iphone

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.

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

Add a new sms into iPhone inbox programmatically

I searched all already asked questions here on Stack Overflow, and all of them deal with "sending" an SMS programmatically to another phone and that is NOT what I want.
I want to just add an SMS to the inbox, without using the cellular network or any other service and write a from "my_company_name" etc. Basically I want to avoid making the user or my company pay for the SMS. I know about push notifications and I will use them as well, but I need SMSs.
I thought about that maybe, if the user sends the SMS to himself it would be free of charge, but that "seems" to be not true at all.
The Messages app (and its notification UIs) only displays messages that come in over SMS or iMessage. What you're looking for isn't possible with public API.
As there is no public API available to do this (I guess you already now that), you'll have to go for the private APIs.
You might want to take a look at the source code of BigBoss's WifiSMS. This app allows one to control the iPhone's SMS system thru your computer. I haven't tested it myself yet, but BigBoss is a pretty credible application creator when it comes to jailbroken devices.

Data Exchange between same iPhone App on separate devices

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

do i need to maintain a database for using push notification on my web server?

how we can maintain push notification for hundreds of devices? do we need to maintain a database on server or apple will maintain this,we just need to send payload.also i'm confusing in this matter that how do i cancel already sent payload...does someone knows about it?
You need to maintain your own database. The payload that you send to Apple includes the device token of the iphone you are sending the message to. Your table could contain as simple as an id for the user (auto-generated id, or email, or whatever you need), mapped to the iphone deviceToken, along with other columns and tables that you need for your book-keeping. The device token can be stored as String for simplicity, but it's really a 32-byte BLOB.
Once you send a payload, you cannot cancel or check its status. Once you send it, it's out of your hands.
I'd head on over to Urban Airship and play around with their implementation of Apple Push Notifications. They have a sample PHP application you can extend to fit your need and great step-by-step documentation on how to get your sample application up and running.
No, there is no way of canceling sent payload.

iPhone Programming: Send a text message? Access contact list?

I'm still new to the API and I wanted to ask:
Can you send a text message programmatically?
Can you access the users contact list programmatically?
I'm thinking no. I haven't seen anything about text messaging in the API, and I figure the sandboxing that the iPhone does keeps you away from the phones contact list.
Thanks everyone.
1) I'm afraid you can't send SMS with the iPhone SDK although you can make a link to send an SMS like so:
a href="sms:408-555-5555">408 555 5555</a>
2) You can access the contact list with the Address Book UI framework
one way round the sms/mms problem is to use an external aggregator then you can utilise http between a server and the iphone to send sms obviously there is a cost involved this way to the developer
Yes You can build an app to send SMS.
All u need a server API, which u gonna call through ur code, to send sms.
I am saying this bcoz i am currently working on it.
As soon as i m done with my app,i am gonna share it.
http://shishir.com?from=shishir&to=shishir&message=hi&sandbox=false&username=user&password=pass
u hv to pass values through URL.
will go in deep very soon.
regards
shishir