興味のある方のために、NSLocale currentLocale次を使用して簡単な方法を見つけました。
// Get the current locale.
NSLocale *currentLocale = [NSLocale currentLocale];
// Get country code, e.g. ES (Spain), FR (France), etc.
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
if ([countryCode isEqualToString:@"FR"]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://0000000000"]];
}
else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://+33000000000"]];
}
if(SYSTEM_VERSION_LESS_THAN(@"7.0")) {
if ([countryCode isEqualToString:@"FR"]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://0000000000"]];
}
else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:+ 33000000000"]];
}
}
美味しく効きます。