包含 *和#的TEL URI不在iOS 15上工作
包含 *和#的TEL URIS不在iOS 15及以后。当我尝试执行以下语句时,
[UIApplication.sharedApplication openURL:[NSURL URLWithString:@"tel://*21*12345#"] options:@{} completionHandler:nil];
它没有在设备上显示任何内容。
NSString *numberToDial = @"*21*12345#";
NSString *encodedNumberToDial = [numberToDial stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", encodedNumberToDial]];
我也尝试对其进行编码,但它不起作用。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据文档:
看来这是API的限制,并且由于安全性而设计。
According to the docs: https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html
It appears that this is a limitation of the API and by design because of security.