不需要的通信扩展不发送网络请求

Unwanted communication extension doesn't send network request

我有垃圾电话报告的不需要的通信分机。我配置了关联的域,在 info.plist 文件中设置了端点。无论如何,当我尝试使用带有 userInfo.junk/notJunk 的 junk/notJunk 操作发送内容时,我在日志中遇到错误。

这是我的 apple-app-site-association 文件

{"classificationreport": {"apps": ["TeamID.ExtensionBundleId"]}, "messagefilter": {"apps": ["TeamID.ExtensionBundleId"]}} 

这是我的 .entitlements 文件

<key>com.apple.developer.associated-domains</key>
    <array>
        <string>classificationreport:myDomain.com</string>
        <string>messagefilter:myDomain.com</string>
    </array>

apple-app-site-association 文件在根目录 myDomain.com/apple-app-site-association

我不认为问题出在我的 apple-app-site-association 文件中,因为我从

收到了 200 条回复
CONNECT app-site-association.cdn-apple.com:443 HTTP/1.1
Host: app-site-association.cdn-apple.com
User-Agent: swcd (unknown version) CFNetwork/1240.0.4 Darwin/20.5.0
Connection: keep-alive
Proxy-Connection: keep-alive

HTTP/1.1 200 Connection established

起初 a 只有一个 classificationreport 键,但在日志中是一个错误

com.apple.IdentityLookup.MessageFilter Extension's containing app (appID <private>) unauthorized to defer requests to host <private>

com.apple.IdentityLookup.MessageFilter Error reporting to network: <Private>

我不明白为什么在不需要的通信扩展有 com.apple.identitylookup.classification-ui 时会有 com.apple.IdentityLookup.MessageFilter 所以我在关联域中添加了一个 messageFilter 键,但它没有改变任何东西

如果您知道出了什么问题,我将不胜感激。

想通了!

不仅是扩展程序,主应用程序也应该有 classificationreportmessagefilter 关联域,主应用程序包 ID 应该在 apple-app-site-association 文件中

{
  "classificationreport": {
    "apps": [
      "TeamID.mainAppBundleID",
      "TeamID.extensionBundleID"
    ]
  },
  "messagefilter": {
    "apps": [
      "TeamID.mainAppBundleID",
      "TeamID.extensionBundleID"
    ]
  }
}