0
我正在开发一个应用程序的PhoneGap,其中包括使用原生拨号符号。我使用此代码以编程方式拨打的号码:拨打电话号码,小于在PhoneGap的iPhone应用程序
(void) dialPhone:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options {
NSString* url;
NSString* number = [options valueForKey:@"number"];
//NSLog(@"number: %@", number);
if([number hasPrefix:@"tel://"]) {
url = number;
}
else {
// escape characters such as spaces that may not be accepted by openURL
url = [NSString stringWithFormat:@"tel://%@", number];
}
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:url]];
}
而且它有一个例外完美的作品:我无法拨通号码,如“10”(完整的URL为tel:// 10)。应用程序根本无所作为。没有警报,没有错误。但是,如果我的实际数量,我需要,像“000”之前多增加一些符号,它的工作原理。 真的找一些指导。