How to make a phone call from Apple?
Is there a way to make phone calls from an extension WatchKit
?
Below is my code.
NSExtensionContext *ctx = [[NSExtensionContext alloc] init];
NSString *cleanedString = [[@"1234567890" componentsSeparatedByCharactersInSet:[[NSCharacterSet characterSetWithCharactersInString:@"0123456789-+()"] invertedSet]] componentsJoinedByString:@""];
NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", cleanedString]];
[ctx openURL:telURL completionHandler:^(BOOL success) {
NSLog(@"fun=%s after completion. success=%d", __func__, success);
}];
+3
source to share
No one has answered this question yet
See similar questions:
or similar: