Send some data to contact from app (Objective-C, Swift) - ios

Is there any way I can send some data to contact from contacts app? for example some string or integer? E.g. I have an app, when user open it the app shows all contacts from Contacts app. and when he tap one of the contact the app must send data to the persons phone. Must I do it with web service or there is any way to do it without web service?
P.S. sorry for my english!

There is no way to do this using built-in iOS libraries without invoking a UI. You can send an SMS message using the MFMessageComposeViewController class. That displays a UI to the user. If I remember correctly you can prepopulate the view with the content you want to send, but the user can edit it.
Likewise there is the MFMailComposeViewController for sending email, with or without attachments.
If you want to send data to another user without displaying a UI to the user you will need to either use a webservice or come up with your own system (involving a server you manage, a TCP socket connection between copies of your app running on both devices, or some other custom development)

Related

How to send user input to designated e-mail?

I am developing an iOS app targeting iOS 9 and above using Swift 3 and xCode 8.
I have a "Contact ViewController" which contains multiple forms where user enters its data to submit. Collected data also contains users' e-mail address. I am validating all the information that entered by the user correctly.
So, what I would like to do is my "send" button to send the user's all data to an e-mail address.
Is this possible without using Mail App or its interface? Do I need additional framework for such functionality?
I appreciate your time and sharing your thoughts.
This is not possible secretly. You can't send an email from the users device via the Apple Mail app because the system will not allow that. You can prepare an email with all the data that opens and let the user send it to you by tapping "Send" in the NavigationBar. So yes, you would need another framework to do that.
But I would not use emails to do that. Just use a server you send the data to or a service like Firebase.
If you really have to send E-mails, and just pushing the data to a backend API is not enough:
This is not possible using built-in functionality, but you could leverage an external mail delivery service like Mailgun to send your mails. (From a security standpoint, this should be handled by a server and not by the app itself however.)

Sending a text message without being prompted [duplicate]

Is it possible to send sms via iphone without user intervention? I already know about MessageUI framework and MFMessageComposeViewController class, but this option requires user to click Send button when MGMessageComposeViewController is presented. I would like the device to automatically, without my help send a text message when certain conditions are met. (I have some sensors connected to the device)
No. You can only open a message ready to send but you cannot send it automatically.
If you want to be able to send sms without user's interaction, consider using some third party gateway. TextMagic provides nice api to send sms, but it is not free. At some point it charges you money. But, they have nice and simple api to use.
Look at this,
http://api.textmagic.com/https-api/textmagic-api-commands#send

How to send a text inside an iOS app?

Is it possible to send a text immediately inside an app. I have implemented the sms send. I just want to bypass the screen where the user has to press send.
There is no way to bypass the MFMessageViewController screen where the user has to tap "send." I assume Apple has designed it this way to prevent an app from potentially spamming a user's contact list.
In addition, there is no way to detect income SMS. Both these features are strictly reserved for the native Messages app.
For more information on sending an SMS on iOS check this out.
One alternative is to implement sending and receiving messages within your app using a web service to store and retrieve messages. For example, you could use a messages library like JSQMessagesViewController documented here and for simplicity's sake, you could use a BaaS like Parse.

MAP bluetooth profile to transfer data

​
I'm looking into MAP profile (on iOS) because is under standard profiles and you don't need MFi to use it.​
My question: is it possible to use MAP profile to transfer data (in messages)? or are you restricted to just messages, calls and emails? In other words - when I send data to phone over MAP profile is data accepted by any application or specifically my messages application (or phone application, or email application).
I hope I was clear :) thx​
My own replay for purposes of "closing" the question.
I couldn't find the way of sending data over MAP - at least on iOS and event if I would manage to send it I'm almost certain that only specific application would be able to accept the data. So for example mail would be accepted by Mail application.

How to send a mail without disclosing recipients mail id in ios

All I am developing an iPhone application in which I have to send mail to recipient without showing email id and the MFMailComposer UI view (i.e without user interaction and also user cant know who is the recipient). Can please tell me how to achieve this?
You cannot send Email without user acceptance. But there are a lot of web-services in internet which can send Email. I guess some app uses those services or uses own.
See also How can I send mail from an iPhone application
You can create a PHP webpage which uses the mail function, just a couple of lines of code.
Then just call the url to that php webpage from your app!

Resources