The Unwanted Communication Reporting extension sends response over the network connection only ONCE after installing. Is it a bug?

Hi,

I just have seen an issue in my project that the Unwanted Communication Reporting extension sends response over the network connection only ONCE after installing. In the second try, after pressing the Done button, I don't see any request sent to my external server. To send response again, I have to re-install the app.

But using SMS is still ok. Every time I press the Done button, the view used to compose SMS appears.

This is my Info.plist to send response over network connection:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSExtension</key>
	<dict>
		<key>NSExtensionAttributes</key>
		<dict>
			<key>ILClassificationExtensionNetworkReportDestination</key>
			<string>https://example.com/api</string>
		</dict>
		<key>NSExtensionPointIdentifier</key>
		<string>com.apple.identitylookup.classification-ui</string>
		<key>NSExtensionPrincipalClass</key>
		<string>$(PRODUCT_MODULE_NAME).UnwantedCommunicationReportingExtension</string>
	</dict>
</dict>
</plist>

The classificationResponse() function is still hit every time I press the Done button, but no request is sent to my external server, except the first try. This is my sample code used to confirm that behavior:

    // Provide a classification response for the classification request
    override func classificationResponse(for request:ILClassificationRequest) -> ILClassificationResponse {
        return ILClassificationResponse.init(action: .reportJunk)
    }

In addition, the Message Filtering extension (in same app) is running as expected.

I'm using:

  • iOS 15
  • Xcode 13

Any comment is highly appreciated. Thanks.

Replies

Update 17:00 GMT+7 05-Feb-2022

I have just found that if I force close the iOS Messages app, the report can be sent to my external server again. It means if I want to continue reporting, I have to force close the iOS Messages app first.

Does it mean there is something unfinished in the last workflow?

Once your view controller is dismissed, to protect user privacy, the system always deletes your extension’s container after your extension terminates.

Hi Rico,

Though I press "Cancel" in the iOS Messages application to end a session (according to my understanding), I must force close the iOS Messages application to make it work again.

I update steps to reproduce:

  1. Install the app contains a Message Filter extension and an Unwanted Communication extension
  2. Enable those 2 extensions in Settings (Phone and Messages)
  3. Open the iOS Messages app
  4. Open a communication thread
  5. Press and hold a SMS message
  6. Press "More..."
  7. Press "Report Messages"
  8. Press "Done" button when that button is available on GUI of the reporting extension
  9. Press "Cancel" button in the iOS Messages application after the GUI of the reporting extension is dismissed
  10. Repeat from step #5 with another SMS

Expected result:

  • There are 2 reports sent to the external server

Actual result

  • There is only one report sent to the external server (step #8)

I have filed a bug report FB9905746 in case anyone else experienced this problem too.

I would like to update some information:

STEPS TO REPRODUCE 
1. Install the app contains a Message Filter extension and an Unwanted Communication extension
2. Enable those 2 extensions in Settings (Phone and Messages)
3. Open the iOS Messages app
4. Receive a SMS from an unknown phone number A
5. Press and hold the SMS message received in step 4
6. Press "More..."
7. Press "Report Messages"
8. Press "Done" button when that button is available on GUI of the reporting extension
9. Press "Cancel" button in the iOS Messages application after the GUI of the reporting extension is dismissed
10. Receive a SMS from an unknown phone number B
11. Press and hold the SMS message received in step 10
12. Press "More..."
13. Press "Report Messages"
14. Press "Done" button when that button is available on GUI of the reporting extension
15. Press "Cancel" button in the iOS Messages application after the GUI of the reporting extension is dismissed

When check device log I see in the first try (step 8), the process MessageFilter appeared but not in the second try (step 14)

com.apple.IdentityLookup.MessageFilter	classification report request: <private>
...
com.apple.IdentityLookup.MessageFilter	Garbage collection for alternative services

Update 15:00 GMT+7 01-Mar-2022

I have tested on another iPhone 11 Pro Max but iOS 14.8.1:

  • I can send the 2nd report, the 3rd report... and so on without doing force close the iOS Messages application
  • But the GUI created by the Unwanted Communication Extension is not displayed immediately (5-6s delay)