json - Swift:如何重新加载内容拦截器
问题描述
我在我的项目中使用“内容拦截器扩展”,并被告知我必须SFContentBlockerManager.reloadContentBlockerWithIdentifier()
在我的主应用程序中调用以重新加载数据blockerList.json.
但我真的不知道我应该怎么称呼它。有任何想法吗?
解决方案
当需要(例如当用户更改某些内容时)从 blockerList.json 重新加载数据时,您调用:
SFContentBlockerManager.reloadContentBlocker(withIdentifier: "your-blocker-id", completionHandler: { error in
if let error = error {
// do something here when an error is thrown
print(error.localizedDescription)
}
})
推荐阅读
- angular - Angular Typescript 错误 - 不推荐使用字符集。(弃用)
- python - 使用python将文件夹中的所有word文档转换为txt
- r - 在 RShiny 中连接到 BigQuery
- reporting-services - 正确报告组但显示错误的标题
- flutter - Flutter,ListView,如何在ListView顶部添加几个项目并使其不滚动到顶部
- python - pytest 默认跳过标记的测试
- javascript - 无法解决承诺
- python - Jinja2 - 对象在 for 循环中表现不同
- python - 当我从 pandas df 转换为字典时,为什么会丢失记录?
- php - 登录后如何显示我的管理员全名 - Codeigniter