I am searching for a way to easily deactivate the safari content blocking from within the app. Any idea how to do this? Can SFContentBlockerManager.reloadContentBlockerWithIdentifier
be helpful for this?
Asked
Active
Viewed 787 times
0
-
hi bro, got any solution ? – ikbal Dec 20 '16 at 07:38
2 Answers
0
If you are displaying data inside SFSafariViewController
it's impossible, because Enabling/Disabling iOS9 Content Blocker is a User Settings.
As far as I understand it, Content blocker doesn't affect UIWebView
.
During beta reloadContentBlockerWithIdentifier
worked in Simulator, but didn't work on real devices.

themoah
- 167
- 2
- 13
0
You can "kinda" disable safari content blocking by providing NSItemProvider
with no rules in the ContentBlockerRequestHandler
.
Whenever user enables/disables content blocking in the main app you can sync this state with the extension e.g. using shared container UserDefaults(suiteName:)
in the App Group
and call SFContentBlockerManager.reloadContentBlockerWithIdentifier
Of course, the extension will have to stay enabled in Settings.

Laevand
- 822
- 9
- 14