getStateOfContentBlocker does not return new state on iOS 15.4

Hi,

Before iOS 15.4, getStateOfContentBlocker would return the correct content blocker state when moving the app to background, going to Safari settings to enable/disable it, and then back to the app.

Now, on iOS 15.4, the state returned by the method is not updated unless I kill the app and start it again.

I confirmed that the same code on iOS 15.2 works as expected.

Running on Xcode 13.3.

Has anyone else experienced this?

Thanks.

Deleted

(^ oops! I meant to leave a comment, not post an answer...)

I'm experiencing the same thing.

Not an answer

Am seeing the same issue on iOS 15.4. getStateOfContentBlocker returns the correct state on initial app launch, however if the state is then changed in the background while the app is running and getStateOfContentBlocker is called again it will return the incorrect initial state of the content blocker, not the correct changed state.

This bug does not occur on iOS 15.3 and earlier with the exact same code. Doesn't seem to be a fix unless the app is killed and re-launched.

Experiencing the same issue on 15.4 too, huge pain for us content blocker developers.

It also looks like SFContentBlockerManager.reloadContentBlocker(withIdentifier:completionHandler:) also doesn't work on iOS 15.4 (at least in the iOS simulator, likely also on device). Calling this method does not reload the content blocking rules for the identified content blocking extension. You need to manually turn the content blocking extension off and on to have the rules reloaded which breaks my app.

Looks like it is fixed in iOS 15.5 beta https://developer.apple.com/documentation/safari-release-notes/safari-15_5-release-notes

Fixed an issue where SFContentBlockerManager.getStateOfContentBlocker() could return an incorrect value on iOS.

It's fixed on iOS 15.5.

getStateOfContentBlocker does not return new state on iOS 15.4
 
 
Q