ContentBlockerRequestHandler类没有被调用?

时间:2017-04-27 03:23:57

标签: ios swift xcode

我已将内容块扩展添加到我的项目中。 &安培;我从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'

1 个答案:

答案 0 :(得分:0)

您需要从xcode功能启用App组 &安培;使用Action测试应用,在safari browser的帮助下触发。 enter image description here