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()
|
||||
|
||||
content.title = webFeed.nameForDisplay
|
||||
content.body = ArticleStringFormatter.truncatedTitle(article)
|
||||
if content.body.isEmpty {
|
||||
content.body = ArticleStringFormatter.truncatedSummary(article)
|
||||
|
||||
if !ArticleStringFormatter.truncatedTitle(article).isEmpty {
|
||||
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.userInfo = [UserInfoKey.articlePath: article.pathUserInfo]
|
||||
|
||||
|
||||
let request = UNNotificationRequest.init(identifier: "articleID:\(article.articleID)", content: content, trigger: nil)
|
||||
UNUserNotificationCenter.current().add(request)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue