-1

我正在使用 VOIP 应用程序。我正在尝试从我的ios 应用程序中拨打电话,该应用程序包含用 (,) 指示的暂停。

      NSString *phoneNumber = [@"telprompt://" stringByAppendingString:finalNumber];
      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

拨打号码时,通话未接通。我可以用什么来暂停我的号码。

4

1 回答 1

1

尝试使用tel://方案:

Objective-C

NSString *telUrl = [NSString stringWithFormat:@"tel://%@,%@", contactPhone, contactExtension];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telUrl]];

迅速

    let formattedPhone = "tel://\(contactPhone),\(contactExtension)"
    if let phoneURL = NSURL(string:formattedPhone) {
        print(phoneURL)
        UIApplication.sharedApplication().openURL(phoneURL)
    }

并确保您的字符串没有空格。

干杯。

于 2016-06-13T19:14:42.897 回答