Both tel: and telprompt: can make a phone call. But what is the difference?
For tel:, iPhone will make the call immediately and will state in Phone app after the call.
For telprompt:, iPhone will ask whether you want call this number and will return to your app after the call.
Be aware that sometimes address book returns the phone number with white space or non-break space. It causes the NSURL returns null. The following code can filter out these 2 types of space.
NSString *phoneNumberString = [[self.tableView.detailTextLabel.text componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
No comments:
Post a Comment