In order to make a call from my app I used the following code:
NSString *phoneNumber = @"666666666";
NSString *phoneURLString = [NSString stringWithFormat:@"tel://%@", phoneNumber];
NSURL *phoneURL = [NSURL URLWithString:phoneURLString];
if ([[UIApplication sharedApplication] canOpenURL:phoneUrl]) {
[[UIApplication sharedApplication] openURL:phoneUrl];
} else
{
calert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Call facility is not available!!!" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil, nil];
[calert show];
}
Its working as expected, but im getting the following error on the Xcode console when I run it on an iPhone:
ERROR: [AVAudioSession Notify Thread] AVAudioSessionPortImpl.mm:49: ValidateRequiredFields: Unknown selected data source for Port iPhone Micrófono (type: MicrophoneBuiltIn)
I searched for information about this error but I have not found anything to help me understand why is happening.
Any ideas?
Thanks
EDITED with CanOpenURL: validation.
I also noticed that im getting the error on iPhone 5 with iOS 9.2 but not on iPhone 6 with iOS 8.2.