ネイティブ ダイヤラーを使用する PhoneGap アプリケーションを開発しています。このコードを使用して、プログラムで番号をダイヤルしています。
(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]];
}
そして、それは 1 つの例外を除いて完全に機能します: 「10」のような番号をダイヤルすることはできません (完全な URL は tel://10 です)。アプリケーションは単に何もしません。アラートもエラーもありません。ただし、必要な実際の数値の前に「000」などの記号を追加すると、機能します。本当にいくつかのガイダンスを探しています。