ios how to retrieve the email addresses from contacts,mail? - ios

i want to retrieve the email ids of users exist in contact and mail app in the device.It just like there is search field to search the user email id and the fallowed table will show the results that contains the search text.And the users email id's need to search in contacts and mail.
can anyone help me out.

You cannot grab any information from the mail.app on an iDevice. Apple's Sandbox rules prevent this sort of thing.
With the contacts - it's possible. You should read up on the Address framework.
Here's Apple documentation on it: https://developer.apple.com/library/ios/documentation/AddressBook/Reference/AddressBook_iPhoneOS_Framework/_index.html

Related

How to get the user information who are not in my roster list?

I am working on group chat using robbiehanson/XMPPFramework. I have done sending invitation,accepting invitation and messaging in group chat.
Here I want to show some information of user who sent message in group chat including his avatar.
I can get the users information from XMPPUserCoreDataStorageObject. this case is applicable only if those users are present in my friend list. I need to get the users information who are not in my friend list. Is there any possible way to achieve this. Please suggest me
In XMPP, avatar (vcard) of any user can be fetched irrespective of roster entries. So if you are trying to query vcard of any other user of your service, then it should work. If it's not working, please provide the both "get" and "result" IQ here for vcard request.
However, if you are trying to query presence status of other user's then yes there is restriction of roster. This can be overcome by implementing following logic:
User registers in your application (Android or iPhone), determine registered contacts of your service from user contact book and automatically add them in your roster.
Also Implement roster request handling in your application that when it get's request for allowing other user to add you in his roster, automatically accept the request and send request to that user to add him in your roster too.
Now again accept that request.
In this way, you can add users in roster behind the scenes and user's can view the information of other users just like WhatsApp.

iOS Facebook SDK searching for users with Graph search

I am new to Graph Search, and I want to search for a user with an email address. Is that possible? Right now, I only know how to search with their name, like this:
https://graph.facebook.com/search?q=chandler+de+angelis&type=user&access_token={access_token}
I have an email address, and I need to check if there is a Facebook account with the same email address. How can I accomplish this?
The answer to this is from Facebook themselves. In post at https://developers.facebook.com/bugs/335452696581712 a Facebook dev says
The ability to pass in an e-mail address into the "user" search type
was removed on July 10, 2013. This search type only returns results
that match a user's name (including alternate name).
That's Facebook's new rules.

Get default user email in iOS Device

Is it possible to retrieve the user email associated with the default email account directly from an app?
Screenshot:
Thanks.
I can't prove a negative, but I am fairly certain this is not possible. You can use MFMailComposeViewController to allow the user to send an email from the default account, but you cannot directly access information about the default account. If you need the user's email address, you either have to ask for them to type it in, or have them select it from their contacts.
In addition to #woz answer, this is a gist that can help you.
In my app, I have a feedback form to let users could get in touch with me. Unfortunately, many users had minor misspellings in their email addresses and I couldn't reach back to them.
As I couldn't get a perfect way to be sure the email was correct, I've developed the following gist which:
asserts the mail is a proper foo#bar.tld
verifies that the email is contained in the user's address book
if not, suggests the closest match
Again, this is far from perfect and I only included this behavior optionally (a little 'check mail' button next to the UITextField)
https://gist.github.com/dirtyhenry/7547064

Getting user Email Yahoo Oauth (using Scribe-Java API)

Trying to access user profile from Yahoo using Oauth system and for that i am taking help of Scribe-Java API
its working fine except one issue whcih i am sure not related to the API i am using
In my yahoo profile i have following settings
Yahoo! Email --->amy_yahoo_id#yahoo.com
Email--->other_id#gmail.com Primary - Change
So what i am getting back is other_id#gmail.com which means i am not able to get correct information of the logged in user.Once i am able to get guid i am sending the request to following URL
http://social.yahooapis.com/v1/user/guid/profile?format=json
any way i can get the yahoo mail id to which user is associated in place of other id even if that is set as primary or along with any other email id all i want is to get the yahoo mail id of the user by which he/she logged in to the system.
Is there any specific reason you must get the yahoo account's email?
I also facing the same problem as you earlier.
After think over, primary email means to be the contactable email for the user.
So may be that's why yahoo make it that way.
Of course it will be good if they can provide one more email which is account's email.
But if you just want to have unique identifier, we can use the guid.
So may be you can check again, does your requirement must have the account's email?
or you just need an email where user set primary because they preferred to be contactable by that email?
Now I will just make use of the primary email return from Yahoo for my OAuth

ios share contact combined with mailto

In IOS I would like have a mailto link with attributes to prefill recipient-address, subjectline, and messagebody. I assume this is supported just like in macosx? Any additional features IOS offers on this?
Within this process of opening a new prefilled email, I would also like to offer the user to add his personal (or other) contact details as a vcf card to the email.
I know the "share contact" button at the bottom of every contact in the contacts app can send contacts as vcf files in mail, but this route doesn't offer me prefilled email fields.
How can I combine the best of both worlds; prefilled email fields and share contact, from a webpage (without using additional ios apps)?
In the worst case, I'd have to ask users to share their contact, and copy paste the recipient-address, subjectline and body. I could copy all 3, with instructions (move subjectline and recipient-address from body to their fields), into the clipboard with JS, and just ask them to paste into the body.
Would that be supported?
Other suggestions?
iOS supports mailto for filling in subject field, message and multiple recipients in the To, Cc, and Bcc fields. The from attribute is not supported. (Source)
However, sharing a contact is not possible from the web browser. You'd have to write a native app.
Take a look at MFMailComposeViewController.
ios user's can't attach their contact info as a vcf to a (mailto induced) email, but can send the vcf, as attachment to a true email (subject line is pre-filled 'contact' but all fields can be changed) from within contacts. If you need the user's contact info, ask them to send it that way, and instruct them what to paste or write in the fields, if important.
So the convenience of automatically inducing a new email from a browser link with pre-filled fields is lost on ios.

Resources