IOS - Safari Content Blocker cannot read data from NSUserDefaults

I’ve been working on the Content Blocking app for some time now. I have a switch in the main application that should include a blocking filter. The value of this switch is stored in the NSUserDefaults property, which is included in application groups, so the lock extension can read whether it is enabled or not (if the lock is enabled, it returns the full json list, and if it does not return empty).

In Simulator, this works fine, but when I run it on the device (tested on 5 and 5c), the extension can no longer read properties from UserDefaults (it always returns nil), and the application can no longer read properties from extensions.

I think this has something to do with application groups, but I cannot find any problems with this (it is included in Capabilities, etc.), so I'm a bit lost. Has anyone had this problem? If so, can you fix it?

I am using Xcode 7 beta, iOS 9 beta2 and Mac OS X Yosemite.

+4
source share

All Articles