iPhone SDK: Getting Contact's Name from the Phone Number - iphone

Does anyone know if there is a preferred method to find a contact's name in the Address book using their phone number as the key?
It seems that this should be a standard function since it is done in several places by the phone, such as in Recent Calls, Voice Mail list, Incoming Call ID, etc.
Thanks,
Anthony

Unfortunately the only way to do it is to enumerate through all the contacts, enumerate through each contacts phone numbers, and check each one until you find a hit. If you think there should be a built in way to query by phone number directly you should file a feature request.

Related

WhatsApp deep link to a specific mobile number

So, a friend of mine told me they have been using Facebook ads to post a deep link to send a whatsapp message and ask for the information about the ad via whatsapp. Bad news: this friend is not very tech savvy so that's all he knows.
Now, the subject actually caught my eye so I started researching. Unfortunately: official documentation states the url scheme for whatsapp is something like:
whatsapp://send?text=WHATEVER_YOU_WANT&abid=RECIPIENT_ADDRESSBOOK_ID
Now: big issue is that the abid (Adress Book ID) is relative to each phone and obeys only to the order each one was added to the specific phone we're talking about. In this case, the contact I want to send the message is 402. But 402 on each of your mobile devices will be any other person. Not the one you want to be.
So I reached the abid by downloading iMazing and sqlitebrowser and making a backup of my iPhone using the iMazing backup tool to then extract the ChatStorage.sqlite from said backup and looking into the sql database. I found that each contact does have an e-mail address time ID named ZCONTACTJID (NUMBERWITHOUT+#s.whatsapp.net) and another id named ZETAG (w:APPARENTLYRANDOMNUMBER;)
Is anyone of you familiar with such ID's or do have a way to make a deep link useful for send a message to a specific number?
Thanks!
For someone like me who is still looking for it, the following link seems to work -
Ping me on WhatsApp
Note: Use the parameter 'phone' and pass the actual phone number value instead of Adress Book ID.
It opens the contact in WhatsApp app, along with the message 'Hello World!' prepopulated in the input text box. The link works even if the phone number is not a valid contact in the phone's contact list.
(Tested this with google chrome on an android phone.)
The WhatsApp ABID is actually the standard iOS ABRecord (source). You can get that programmatically if you're writing a native iOS app, but unfortunately there's no way to access it within the context of a Facebook ad. And in any case, the abid is totally unsupported on WhatsApp Android (source).
A workaround would be to specify the number to send to within the message text, so that the user can enter it manually. Hacky, but maybe better than nothing...
Maybe you should better use the official Whatsapp API mentioned in THIS OTHER ANSWER (because S.O. policies I had to put a link to the solution, no duplicates).
Check this out. This is the updated one...
https://wa.me/<PHONE NUMBER WITH COUNTRY CODE/>?text=<MESSAGE />
For me something else worked:
intent://send/+31612345678#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end

Is it possible to get the current user's address book record?

Assuming the user has granted permission for the app to access contacts, is there any way to determine which record belongs to the phone owner? For example if you browse the list of contacts on your phone, you will see a little "me" beside the record that is identified as the owner's record. So the phone clearly knows this, but is there any programmatic way to determine this? Or is that considered a privacy violation?
I know on a Mac you can use [[ABAddressBook sharedAddressBook] me]. For iOS, take a look at how Square's CardCase app does it.

search specific number in iphone contacts

I am developing a Voip application. My application has its own call logs and screen is same as native call logs. Application also has its own contacts received from server and also has iphone contacts option which display iphone's contacts like Skype.
Problem :
If any contact suppose "9999999999" is stored in native contacts i.e. in iphone contacts. It will be stored as "99-99-999999" in iphone. Now suppose incoming call in my application comes from "+919999999999" number (means with country code).
My app should find name for that number and display it. And call log detail screen should display all information which is stored in iphone's contacts (like photo, multiple number, etc.)
To search name for number I have used This. But given method in like compares exact number (not compare number with or without country code).
Is there any API available ?
I don't know how it is possible because "Bria" and "Viber" application does this.
Any help....
Thanks in advance.

Use Address Book for search firstname when receive notification on iphone app

I spend some days to search solution about this trouble :
I have an app wich receive notificaiton from other user. The single data, I have under server side is the number phone. So I want, when the notification is receive on the iphone, to link the number phone of sender to the addressbook of receiver for display, if the number phone is foud, the firstname of the sender to the notification.
This feature is like sms reception on the iphone, where is just the number phone used finally, and is linked to the address book.
The notification system on my app is enabled and run without trouble, but this feature is not resolved, and i found the response nowhere on the net.
Ok, i search more, and i think, this feature could be possible if the app can write under the Localize.string. In fact, it could be possible to write key value, like ("93019320"="Carla") and in the notification text the phone number "93019320" is replace by the string "Carla". But the second question is
Is it possible to write in Localiza.string under app?

display email inbox?

is there an option that I could retrieve from my app the latest 10 email subjects from my ipad email inbox.
I would like to display the user his last 10 subjects in my new app.
Any Ideas if this is possible and how?
best
chris
No, it's not. Apple doesn't allow access to most user data that's handled by the built-in native software, and even then generally not without the user explicitly giving the app access (such as in an address book picker).