search specific number in iphone contacts - iphone

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.

Related

Editing contact picture programmatically on receiving the call , does Apple allows that?

I am developing the App, When i receive the call ,I am changing the contact picture of that person who has called , I am fetching his number from the server , i know i cannot access the incoming number ,so by developing this kind of application will apple approve my App ?
I am not violating any Guideline or Rules ,but i just want to know does Apple allows this changing the contact picture of person programmatically ?
You can change a contact picture, check the Address Book Programming Guide for iOS.
About that idea of doing something when you get a call, your app can't be notified when you get an incoming call, there's no API for that, so there's no way of doing this the way you are planning.

How to retrieve contact numbers and save them?

I am developing an emergency Android application and I don't know how to retrieve contacts (for ex. 4) from the phone's catalogue firstly, and then save the selected in the app. database. Thus, whenever I want to send an emergency sms I don't have to retrieve contacts again or add any numbers. This is for an assignment so any ideas would be very useful for me. Thanks!

iOS ABPersonViewController: Returning to app after phone call/message/email

I'm using an ABPersonViewController and I was wondering if it is possible to return to my application after making a phone call or sending an email/message instead of exiting to the respective native apps.
On the iPhone Contacts app, you can make a phone call by pressing the phone number field. Ending the call automatically takes you back to the contact screen. You can also send an email and message by clicking on the respective fields (though ending the email/message action does not take you back to the Contacts).
To be more specific, tapping on "mobile 1 (555) 555-5559" should make a phone call to that number (my app already does that). However, when I end the call, I would like to be directed back to my app and not the native iOS Phone app. I would like similar actions for sending an email and message too.
If this is possible, it would be great if someone could share the solution! Thanks for any help.
it is possible to return to my application after making a phone call or sending an email/message instead of exiting to the respective native apps.
AND
Ending the call automatically takes you back to the contact screen
In SHORT : It is not possible because Apple/iOS Does not Provide this type of Feature.

How to determine if phone number has changed?

Currently I am developing an authentication module for my application. The user provides his phone number and a SMS with some pin code is send to him.
The user enters the code and if it is valid his phone number is authenticated. Maybe you know WhatsApp, it does quite the same when you run the app first time.
However if the user puts a new sim card in his phone he should authenticate it again.
I want to know how to determine if phone number has changed. I read in some other question that it is not possible to determine the phone number itself. But e.g. WhatsApp recognizes that there is another phone number.
Any ideas?
Update 2
One (not the best) way it's detecting carrier changing. Here you can see how to get carrier's name. Save it at first launch and do compare on next launches.
Update 3
I'd recommend to you look at Core Telephony Network reference and especially at CTTelephonyNetworkInfo reference
subscriberCellularProviderDidUpdateNotifier allow you respond on events such like:
... when the user’s cellular provider information changes. This occurs, for example, if a user
swaps the device’s SIM card with one
from another provider, while your
application is running

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

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.