Search code examples
iosswiftextension-methods

Unwanted communication extension doesn't send network request


I have unwanted communication extension for calls spam report. I configured associated domains, set endpoint in info.plist file. Anyway i have an error in logs when im trying to send something using junk/notJunk action with userInfo.

Here is my apple-app-site-association file

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

and here is my .entitlements file

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

apple-app-site-association file is in root directory myDomain.com/apple-app-site-association

i don't think that problem is in my apple-app-site-association file cause i 200 response from

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

At first a had only a classificationreport key, but in logs was an error

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

and

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

I don't understand why there is a com.apple.IdentityLookup.MessageFilter when unwanted communication extension has com.apple.identitylookup.classification-ui so i added a messageFilter key in associated domains, but it didn't change anything

If you have any ideas of what's going wrong i will be very grateful.


Solution

  • Figured it out!

    Not only extension but main app should have classificationreport and messagefilter associated domains and main app bundle id should be inside apple-app-site-association file

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