ios 不需要的通信报告扩展无法发送网络请求

iyfjxgzm  于 2023-05-30  发布在  iOS
关注(0)|答案(1)|浏览(187)

我正在应用程序支持中创建“不需要的通信报告”扩展。我只找到了Apple的这篇指南:https://developer.apple.com/documentation/sms_and_call_reporting/sms_and_call_spam_reporting我跟着它
我做了:

  • 从ILClassificationUIExtensionViewController示例化我的ViewController。
  • 调用控制器的prepare(for:)方法来自定义UI。
  • 创建按钮,以在完成信息收集后通知系统(将isReadyForClassificationResponse属性设置为true。)
  • 按下Done按钮后配置classificationResponse(for:)方法。

我想通过网络发送响应,所以我按照以下说明将关联的域添加到扩展:https://developer.apple.com/documentation/xcode/supporting-associated-domain和来自互联网的建议。(支持关联域的Apple文档截图:https://i.stack.imgur.com/zxroa.png

  • 创建文件apple-app-site-association,在指定域时使用classificationreport而不是webcredentials。
{
 "applinks": {
  "apps": [],
  "details": [
   {
    "appID": “XXXX.com.project.UnwantedCommunicationExtension",
    "paths": ["*"]
   }
  ]
 },
 "classificationreport": {
   "apps": ["XXXX.com.project.UnwantedCommunicationExtension"]
  }
}

调试和代理我的应用程序,它不会向服务器发送任何请求。我找不到任何关于应该发送什么请求类型,服务器将接收什么数据类型的信息。有谁能帮忙找一下这方面的资料吗?也许建议我做错了什么,什么设置应该在服务器上?

hec6srdp

hec6srdp1#

您的apple-app-site-association应该看起来像这样(带有应用标识符,而不是扩展标识符):

{
 "classificationreport": {
   "apps": ["XXXX.com.project"]
  }
}

相关问题