如何从我的 iOS 应用程序的设置中打开呼叫阻止和识别 您所在的位置:网站首页 ipad禁止打开应用程序 如何从我的 iOS 应用程序的设置中打开呼叫阻止和识别

如何从我的 iOS 应用程序的设置中打开呼叫阻止和识别

2024-07-11 22:33| 来源: 网络整理| 查看: 265

我使用的是 ios 14,想在按下按钮时从我的应用程序中打开呼叫阻止和识别。为此,我使用以下代码

import SwiftUI import CallKit struct ContentView: View { var body: some View { VStack { Button(action: openCallerIDSettings) { Text("Open Caller ID Settings") .padding() .background(Color.blue) .foregroundColor(.white) .cornerRadius(8) } } } private func openCallerIDSettings() { CXCallDirectoryManager.sharedInstance.openSettings { err in print(";;;",err as Any) } } }

但它只能打开主电话设置。我想打开来电拦截和识别,我已经尝试过不同的方法,例如使用App-prefs方法

private func openCallerIDSettings() { if let url = URL(string: "App-prefs:Phone&path=CLASSIFICATION_AND_REPORTING") { if UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url, options: [:], completionHandler: nil) } } }

但找不到呼叫阻止和识别的确切字符串



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有