mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
修复打开APP,持续响铃不关闭的问题。
This commit is contained in:
parent
7d39977990
commit
fb31e0aaaf
@ -213,16 +213,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|||||||
|
|
||||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||||
ServerManager.shared.syncAllServers()
|
ServerManager.shared.syncAllServers()
|
||||||
|
|
||||||
// 设置 -1 可以清除应用角标,但不清除通知中心的推送
|
// 设置 -1 可以清除应用角标,但不清除通知中心的推送
|
||||||
// 设置 0 会将通知中心的所有推送一起清空掉
|
// 设置 0 会将通知中心的所有推送一起清空掉
|
||||||
UIApplication.shared.applicationIconBadgeNumber = -1
|
UIApplication.shared.applicationIconBadgeNumber = -1
|
||||||
// 如果有响铃通知,则关闭响铃
|
|
||||||
stopCallNotificationProcessor()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
// 如果有响铃通知,则关闭响铃
|
||||||
|
stopCallNotificationProcessor()
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationWillTerminate(_ application: UIApplication) {
|
func applicationWillTerminate(_ application: UIApplication) {
|
||||||
|
|||||||
@ -28,17 +28,13 @@ class SectionViewModel: ViewModel, ViewModelType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initSectionItems() -> Observable<[SectionModel<String, SectionItem>]> {
|
func initSectionItems() -> Observable<[SectionModel<String, SectionItem>]> {
|
||||||
return Observable.create { (observer) -> Disposable in
|
let sectionItems = [
|
||||||
let sectionItems = [
|
SectionItem(image: UIImage(named: "baseline_gite_black_24pt"), title: NSLocalizedString("service")),
|
||||||
SectionItem(image: UIImage(named: "baseline_gite_black_24pt"), title: NSLocalizedString("service")),
|
SectionItem(image: Icon.history, title: NSLocalizedString("historyMessage")),
|
||||||
SectionItem(image: Icon.history, title: NSLocalizedString("historyMessage")),
|
SectionItem(image: UIImage(named: "baseline_manage_accounts_black_24pt"), title: NSLocalizedString("settings")),
|
||||||
SectionItem(image: UIImage(named: "baseline_manage_accounts_black_24pt"), title: NSLocalizedString("settings")),
|
]
|
||||||
]
|
let section = [SectionModel(model: "", items: sectionItems)]
|
||||||
let section = [SectionModel(model: "", items: sectionItems)]
|
return Observable.just(section)
|
||||||
observer.onNext(section)
|
|
||||||
observer.onCompleted()
|
|
||||||
return Disposables.create()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func transform(input: Input) -> Output {
|
func transform(input: Input) -> Output {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user