mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-24 00:30:51 +01:00
Merge pull request #2077 from stuartbreckenridge/notifications
Notifications
This commit is contained in:
commit
fd6736a897
@ -47,14 +47,20 @@ private extension UserNotificationManager {
|
|||||||
let content = UNMutableNotificationContent()
|
let content = UNMutableNotificationContent()
|
||||||
|
|
||||||
content.title = webFeed.nameForDisplay
|
content.title = webFeed.nameForDisplay
|
||||||
content.body = ArticleStringFormatter.truncatedTitle(article)
|
|
||||||
if content.body.isEmpty {
|
if !ArticleStringFormatter.truncatedTitle(article).isEmpty {
|
||||||
content.body = ArticleStringFormatter.truncatedSummary(article)
|
content.subtitle = ArticleStringFormatter.truncatedTitle(article)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content.body = ArticleStringFormatter.truncatedSummary(article)
|
||||||
|
|
||||||
|
content.threadIdentifier = webFeed.webFeedID
|
||||||
|
content.summaryArgument = "\(webFeed.nameForDisplay)"
|
||||||
|
content.summaryArgumentCount = 1
|
||||||
|
|
||||||
content.sound = UNNotificationSound.default
|
content.sound = UNNotificationSound.default
|
||||||
content.userInfo = [UserInfoKey.articlePath: article.pathUserInfo]
|
content.userInfo = [UserInfoKey.articlePath: article.pathUserInfo]
|
||||||
|
|
||||||
let request = UNNotificationRequest.init(identifier: "articleID:\(article.articleID)", content: content, trigger: nil)
|
let request = UNNotificationRequest.init(identifier: "articleID:\(article.articleID)", content: content, trigger: nil)
|
||||||
UNUserNotificationCenter.current().add(request)
|
UNUserNotificationCenter.current().add(request)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user