小编Igo*_*nko的帖子

等到使用 removePendingNotificationRequests ios 10 swift 3 删除来自 UNUserNotificationCenter 的本地通知

使用来自UNUserNotificationCenter. 我尝试删除带有一些标识符的通知:

UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: identifiers)
Run Code Online (Sandbox Code Playgroud)

并从文档:

此方法异步执行,删除辅助线程上挂起的通知请求。

完成处理程序不存在。那么我怎么知道它什么时候真的被删除了呢?在继续之前,我需要确保此标识符不再存在。

我知道我可以使用下一个代码

notificationCenter.getPendingNotificationRequests { (requests) in
        for request in requests {
         }
}
Run Code Online (Sandbox Code Playgroud)

但是,如果我在删除后立即运行此代码 - 它们仍然存在。但是一段时间后,在代码中它们消失了。当您即将达到 64 条通知的限制时,在添加新通知之前尤其重要

ios swift3 ios10 unusernotificationcenter

5
推荐指数
1
解决办法
1225
查看次数

Behat 3:如何在FeatureContext中获取配置文件名称

我开始说

./bin/behat --suite=SuiteName --profile=profile_name
Run Code Online (Sandbox Code Playgroud)

是否有可能在FeatureContext中获取当前的behat配置文件名称,尤其是内部 BeforeSuiteScope

/**
 * @BeforeSuite
 */
public static function beforeSuite(BeforeSuiteScope $scope)
{
}
Run Code Online (Sandbox Code Playgroud)

php autotest behat mink

2
推荐指数
1
解决办法
480
查看次数

标签 统计

autotest ×1

behat ×1

ios ×1

ios10 ×1

mink ×1

php ×1

swift3 ×1

unusernotificationcenter ×1