It is official that you can use Native app URL strings for FaceTime video calls:
facetime:// 14085551234
facetime://[email protected]
Please refer to the link: https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/FacetimeLinks/FacetimeLinks.html
Though this feature is supported on all devices, you have to change the code a little bit for iOS 10.0 and above as openURL(_:) is deprecated.
https://developer.apple.com/documentation/uikit/uiapplication/1622961-openurl?language=objc
Please refer code below for the current and fallback mechanism, so this way it will not get rejected by Appstore.
-(void) callFaceTime : (NSString *) contactNumber
{
NSURL *URL = [NSURL URLWithString:[NSString
stringWithFormat:@"facetime://%@", contactNumber]];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:URL options:@{}
completionHandler:^(BOOL success)
{
if (success)
{
NSLog(@"inside success");
}
else
{
NSLog(@"error");
}
}];
}
else {
// Fallback on earlier versions
NSString *faceTimeUrlScheme = [@"facetime://"
stringByAppendingString:contactNumber];
NSURL *facetimeURL = [NSURL URLWithString:faceTimeUrlScheme];
// Facetime is available or not
if ([[UIApplication sharedApplication] canOpenURL:facetimeURL])
{
[[UIApplication sharedApplication] openURL:facetimeURL];
}
else
{
// Facetime not available
NSLog(@"Facetime not available");
}
}
}
in contactNumber either pass phone number or appleid.
NSString *phoneNumber = @"9999999999";
NSString *appleId = @"[email protected]";
[self callFaceTime:appleId];
objective-c ios