有没有办法以编程方式转发i-phone中的电话。我试过像* 21 *电话号码# 转发呼叫。当我使用此代码打电话给正常号码时,它正在工作。但是当我添加 21 时,它无效。这是我尝试过的可能性。
-(IBAction)two
{
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://*21*+91 90-43-137902#"]];
NSString *phoneNumberString=@"*21*90-43-137902#";
NSString *phoneLinkString = [NSString stringWithFormat:@"tel:%@",phoneNumberString];
NSURL *phoneLinkURL = [NSURL URLWithString:phoneLinkString];
[[UIApplication sharedApplication] openURL:phoneLinkURL];
}
-(IBAction)three
{
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://*21*09043137902#"]];
NSString *phoneNumberString=@"*21*9043137902#";
NSString *phoneLinkString = [NSString stringWithFormat:@"tel:%@",phoneNumberString];
NSURL *phoneLinkURL = [NSURL URLWithString:phoneLinkString];
[[UIApplication sharedApplication] openURL:phoneLinkURL];
}
-(IBAction)four
{
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:*21*09043137902#"]];
NSString *phoneNumberString=@"*21*09043137902#";
NSString *phoneLinkString = [NSString stringWithFormat:@"tel:%@",phoneNumberString];
NSURL *phoneLinkURL = [NSURL URLWithString:phoneLinkString];
[[UIApplication sharedApplication] openURL:phoneLinkURL];
}
-(IBAction)five
{
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://*21*090-43-137902#"]];
NSString *phoneNumberString=@"*21*090-43-137902#";
NSString *phoneLinkString = [NSString stringWithFormat:@"tel:%@",phoneNumberString];
NSURL *phoneLinkURL = [NSURL URLWithString:phoneLinkString];
[[UIApplication sharedApplication] openURL:phoneLinkURL];
}
感谢任何帮助。