然而,尝试使用Firebase注册远程通知时,当实现以下代码时,我会得到错误:
FIRApp.configure()
//Resource code from stackoverflow to create UNUserNotificationCenterlet center = UNUserNotificationCenter
解决方案代码:print(center.getPendingNotificationRequests(completionHandler: { error in }))
我正在尝试通过UNUserNotificationCenter获取挂起通知的列表这是我使用的代码:
let center = UNUserNotificationCenter</e
ask user authorization to receive notification let center = UNUserNotificationCenter.currentregister for remote notifications with error: \(error)")
func userNotificationCenter(_ center: UNUserNotificationCenter
为此,我希望在单元测试中编写一个测试,该测试仅在共享requestAuthorization(options:completionHandler:)实例调用其UNUserNotificationCenter我试过嘲笑UNUserNotificationCenter:
var didRequestAuthorizatio