I have the following code to make phone calls from within the app. However, whenever I click on the button - nothing happens. Any thoughts what I might be doing wrong?
- (void)phonePressed:(id)sender
{
UIButton *btn = (UIButton* )sender;
NSString *key = [self.dictArray.allKeys objectAtIndex:btn.tag];
NSMutableArray *arrData = [self.dictArray objectForKey:key];
NSMutableDictionary *dict = [arrData objectAtIndex:btn.tag];
UIApplication *application = [UIApplication sharedApplication];
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",[dict objectForKey:@"contact_phone"]]];
[application openURL:URL options:@{} completionHandler:^(BOOL success) {
if (success) {
NSLog(@"Opened url");
}
}];
}