Unwanted Communication Extension -> file report via network, how to add Token?

We've had the Unwanted Communication Extension working since iOS 12 beta v1 in June, sending reports via SMS, but the Apple documentation was recenly updated to show the ILClassificationAction can now be sent via Network (instead of SMS). We updated ILClassificationExtensionNetworkReportDestination in the info.plist and setup a test API endpoint with the Association File.


We are now able to file reports via Network request exectued by the OS, however the test api endpoint is a non authenticated endpoint. In production the API endpoint will require an auth token be included in the request. There is nothing in the documentation on how to do this.


Does anyone know how to add auth headers or dynamic url paramters to the network request executed by the OS after the user selects a ILClassificationAction?

Replies

Are you doing a POST request? Seems like you are ahead of me.. I have been trying to hit the network the same way i was sending the sms before. but My endpoint is not getting hit and the logs aren't much of a help either..

   override func classificationResponse(for request:ILClassificationRequest) -> ILClassificationResponse {

        let userAction:ILClassificationAction =  ILClassificationAction.reportJunk;
        let userData:ILClassificationResponse = ILClassificationResponse.init(action: userAction)
        let ilmessage:ILMessageClassificationRequest = request as! ILMessageClassificationRequest;
        let messageCom = ilmessage.messageCommunications;

        userData.userInfo = ["dateRecieved": messageCom[0].dateReceived.description.description ]

    
        return userData
    }

Yes the app, rather the OS, is hitting the Reporting api endpoint. Did you setup network as your il communication preference in info.plist and did you set up the server endpoint correctly follwing Apples Associatd Domains How To, specifically placing the file on the server? Can't recall the name of it.

I am trying to implement reporting extension and it works ok with when SMS is used for reporting. But I'm facing issues when reporting is done on Network (using ILClassificationExtensionNetworkReportDestination in info.list).

I have setup a simple https server as network endpoint (on internal network) and followed the instructions for 'setting up associated domains' given in documentation.

At this point, I'm not seeing any hit (connect request or anything) on https server whenever network reporting is used.

I will appreciate any inputs how to identify the problem area.