Testing ------- Conditional pass Device: iPhone 15 Pro simulator iOS: 17.0.1 Damus: This commit Coverage: 1. Mention notification works (local and push). PASS 2. Thread replies do not appear (but upon code inspection it seems like it was not supported before). PASS? 3. DM notification works with decryption (local and push). PASS 4. Zaps not yet implemented. Coming later. Closes: https://github.com/damus-io/damus/issues/1702 Closes: https://github.com/damus-io/damus/issues/1703 Changelog-Changed: Improve push notification support to match local notification support Signed-off-by: Daniel D’Aquino <daniel@daquino.me> Signed-off-by: William Casarin <jb55@jb55.com>
30 lines
821 B
Swift
30 lines
821 B
Swift
//
|
||
// NotificationExtensionState.swift
|
||
// DamusNotificationService
|
||
//
|
||
// Created by Daniel D’Aquino on 2023-11-27.
|
||
//
|
||
|
||
import Foundation
|
||
|
||
struct NotificationExtensionState: HeadlessDamusState {
|
||
let ndb: Ndb
|
||
let settings: UserSettingsStore
|
||
let contacts: Contacts
|
||
let muted_threads: MutedThreadsManager
|
||
let keypair: Keypair
|
||
let profiles: Profiles
|
||
|
||
init?() {
|
||
guard let ndb = try? Ndb(owns_db_file: false) else { return nil }
|
||
self.ndb = ndb
|
||
self.settings = UserSettingsStore()
|
||
|
||
guard let keypair = get_saved_keypair() else { return nil }
|
||
self.contacts = Contacts(our_pubkey: keypair.pubkey)
|
||
self.muted_threads = MutedThreadsManager(keypair: keypair)
|
||
self.keypair = keypair
|
||
self.profiles = Profiles(ndb: ndb)
|
||
}
|
||
}
|