0

I want to get contacts information and make a call to their phoneNumber programmatically, I have searched a lot but I couldn't find objective-C code to access contacts and make the call. I'm using the following code for calling:

  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://PhoneNumber"]];

Please let me know how I can call a contact programmatically.

Niloufar
  • 512
  • 1
  • 5
  • 24

1 Answers1

1

The URL scheme you need is tel:

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://PhoneNumber"]];
SomeGuy
  • 9,670
  • 3
  • 32
  • 35
  • Thanks, The URL scheme telPrompt is also working, but I'm asking how I can access contact information? – Niloufar Oct 04 '15 at 14:12
  • @Niloufar in that case check out the Contacts.framework (iOS 9 only) https://developer.apple.com/library/prerelease/ios/documentation/Contacts/Reference/Contacts_Framework/index.html#//apple_ref/doc/uid/TP40015328 If you want iOS <=8 then use the AddressBook.framework from the dupe link – SomeGuy Oct 04 '15 at 14:49