我已将内容块扩展添加到我的项目中。 &安培;我从safari设置启用了扩展,但是没有调用beginrequest方法。任何想法都将受到高度赞赏。
class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling {
func beginRequest(with context: NSExtensionContext) {
let attachment = NSItemProvider(contentsOf: Bundle.main.url(forResource: "blockerList", withExtension: "json"))!
let item = NSExtensionItem()
item.attachments = [attachment]
context.completeRequest(returningItems: [item], completionHandler: nil)
}
// All I need is to get called beginRequest method
但我收到错误
无法查找内容拦截器' com.xx.xx.xx'