Load contacts to retrieve email address and send email - iphone

I am new to iphone world i want to ask a question:
There is a contact button in my IOS app, all what i want to do is when user tap on that button it opens up my phone contacts , i chose any of the email of my friend from that contacts and then i send email to that address..
I want to achieve this functionality.
I have done its vice versa using messageUI framework. At their when you tap on email a + button appears and when you click on it a contact page open you chose the email address from there. I actually want this functionality on my contact button.
When i tap contacts my phone contacts load i select a contact from there and send email to it. I dont know how to do this in iphone.

Have you looked at some apple documentation like this? Also would help if you posted sample code.

Related

Adding vCard to Contacts in iOS 13

we have a web site that allows people to click on a link to a vCard .vcf file to install contact details on their phone. The method for handling this has changed in iOS 13 and it is really confusing people. Previously, the vCard opened in the Contacts app and there was a Save button to add it to contacts. Simple, and people understood it. Now the vCard opens in a preview, but there is no obvious way to save it to their contacts. They have to know to tap the Actions icon, then find the Contacts entry and tap that. Very few people can work that out, instead they just tap the Done button, thinking it has been added. Adding a vCard to your contacts has become too hard for most people to work out.
Does anyone know of a trick whereby we can skip the preview screen and open the vCard directly in the Contacts app?
Gary
Including vCard information within a QR code as plain text (not a linked .vcard file) prompts users to add this information to their contacts app—a simple user experience for both iOS and Android users.
From what I've found, requesting any iOS or Android user to download a .vcard file leads to a confusing user experience which should be avoided.
Not sure how helpful you'd find it to include a QR code on a mobile website, but it's one option you have.
You might try to embed the vcard in an ical element like described in iPhone: how to get safari to recognize a vcard?

How do I open the Contacts app Swift

Is there a URL to open the contacts application from within my application? I know you can achieve this with the settings app by using the UIApplicationOpenSettingsURLString constant in Swift; however, I wasn't sure if I could do the same with the Contacts app.
There isn't a deep link for opening the Contacts App.
Apple is very picky when it comes to deep-linking. They have to provide one for Settings since many apps need services like Data, Location, Bluetooth, Wifi, etc.
Unfortunately they do not extend this to the Contacts App.
However if your app needs contact information then for that Apple has provided a Contacts framework to browse through your contacts within your app itself.
Read more about it here.
In order to add/update/delete/merge contacts directly from your app without using the Apple's Contact UI, use the CNSaveRequest APIs. More on that here.
The closest thing you can get to opening a contact is to write them a message in IMessage. From this screen the user can press the contact icon and open the contact page for that particular contact.
You can do this by opening the url sms://+44776382223 where the number is the number of the person that you would like to view the contact of.

Opening an email in an iOS app

When holding down an email address in safari or mail client, a menu pops with the following options: new message, add to contacts, and copy. Is there a way to ad an option to this menu as a third party app that would open that app and insert that email address into it?
Take a look at MFMailComposeViewController in the MessageUI framework.

Directly send sms from app by clicking button in app

I am working on application. I want to send sms to number directly by clicking button in my app. currently my app is sending sms to number but it first shows the messages view and then there is a send button as i've done:
presentModalViewController:controller
i want the message to be sent without showing the Modal view
You can't this is not allowed.
This way you could send hunders or thousands of messages without the user noticing, thus apple does not allow you to do that.
That's not possible. You have to show the user de message view where he can send the sms. If it would be possible to add a 'send sms' function directly to a button, that would be a huge security flaw!
No. There is no official way on iOS to send a message without presenting the dialog and the user clicking send. Maybe on a jailbroken device you could, but definitely not on the app store.

Create VCards with iPhone Address Book Contacts

I am wondering if there is some way to create and send VCards based upon the iPhone Address Book information from my own app. On the Mac, there is some easy function in the built in app to do this, but I have not seen something on the iPhone like this. So, is there some framework or otherwise that enables me to turn contacts on the iPhone into VCards?
Thanks for any help!
There is a "share contact" button at the bottom of every contact in the contacts app on the phone, press it and you can email a VCard to whoever you want.