[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
[NSString stringWithFormat:@"tel:%@",cell.detailTextLabel.text]] 
options:@{UIApplicationOpenURLOptionUniversalLinksOnly:@(NO)} 
completionHandler:nil];

此处关键在于options的设置:
在UIApplication.h 处有提供


// Option for openURL:options:CompletionHandler: only open URL if it is a valid universal link with an application configured to open it
// If there is no application configured, or the user disabled using it to 
open the link, completion handler called with NO
UIKIT_EXTERN NSString *const UIApplicationOpenURLOptionUniversalLinksOnly NS_AVAILABLE_IOS(10_0);

设置UIApplicationOpenURLOptionUniversalLinksOnly为YES并打开URL时, 如果用户并没有安装app那它就会失败,同时会调用safari来打开这个链接。

   
   
   

友情链接:

技术博客        简书主页

相关文章:

  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-20
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2021-08-11
  • 2021-10-11
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案