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.

  • I'm experiencing the same thing.

  • 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.

Replies

Deleted

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

Not an answer

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.

  • This doesn't mention a resolution to the fact that SFContentBlockerManager.reloadContentBlocker(withIdentifier:completionHandler:) is also broken on iOS 15.4 – it doesn't actually reload the content blocking definitions.

    Has anyone with iOS 15.5 beta installed confirmed if this also works as expected now?

Add a Comment

It's fixed on iOS 15.5.