Populate the persistent identifier to make Notes aware of the current activity on Monterey.

This commit is contained in:
Maurice Parker 2021-09-20 14:31:56 -05:00
parent 04d7ab188f
commit 86d62cff33
1 changed files with 5 additions and 3 deletions

View File

@ -175,10 +175,11 @@ private extension ActivityManager {
activity.userInfo = [UserInfoKey.feedIdentifier: articleFetcherIdentifierUserInfo] activity.userInfo = [UserInfoKey.feedIdentifier: articleFetcherIdentifierUserInfo]
activity.requiredUserInfoKeys = Set(activity.userInfo!.keys.map { $0 as! String }) activity.requiredUserInfoKeys = Set(activity.userInfo!.keys.map { $0 as! String })
activity.persistentIdentifier = feed.feedID?.description ?? ""
#if os(iOS) #if os(iOS)
activity.suggestedInvocationPhrase = title activity.suggestedInvocationPhrase = title
activity.isEligibleForPrediction = true activity.isEligibleForPrediction = true
activity.persistentIdentifier = feed.feedID?.description ?? ""
activity.contentAttributeSet?.relatedUniqueIdentifier = feed.feedID?.description ?? "" activity.contentAttributeSet?.relatedUniqueIdentifier = feed.feedID?.description ?? ""
#endif #endif
@ -200,11 +201,12 @@ private extension ActivityManager {
activity.isEligibleForHandoff = true activity.isEligibleForHandoff = true
activity.persistentIdentifier = ActivityManager.identifer(for: article)
#if os(iOS) #if os(iOS)
activity.keywords = Set(makeKeywords(article)) activity.keywords = Set(makeKeywords(article))
activity.isEligibleForSearch = true activity.isEligibleForSearch = true
activity.isEligibleForPrediction = false activity.isEligibleForPrediction = false
activity.persistentIdentifier = ActivityManager.identifer(for: article)
updateReadArticleSearchAttributes(with: article) updateReadArticleSearchAttributes(with: article)
#endif #endif