From 86d62cff33f55d00a5af990fe23e9b688b6ec8f8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 20 Sep 2021 14:31:56 -0500 Subject: [PATCH] Populate the persistent identifier to make Notes aware of the current activity on Monterey. --- Shared/Activity/ActivityManager.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Shared/Activity/ActivityManager.swift b/Shared/Activity/ActivityManager.swift index 266911e5d..ab369c087 100644 --- a/Shared/Activity/ActivityManager.swift +++ b/Shared/Activity/ActivityManager.swift @@ -175,13 +175,14 @@ private extension ActivityManager { activity.userInfo = [UserInfoKey.feedIdentifier: articleFetcherIdentifierUserInfo] activity.requiredUserInfoKeys = Set(activity.userInfo!.keys.map { $0 as! String }) + activity.persistentIdentifier = feed.feedID?.description ?? "" + #if os(iOS) activity.suggestedInvocationPhrase = title activity.isEligibleForPrediction = true - activity.persistentIdentifier = feed.feedID?.description ?? "" activity.contentAttributeSet?.relatedUniqueIdentifier = feed.feedID?.description ?? "" #endif - + return activity } @@ -200,11 +201,12 @@ private extension ActivityManager { activity.isEligibleForHandoff = true + activity.persistentIdentifier = ActivityManager.identifer(for: article) + #if os(iOS) activity.keywords = Set(makeKeywords(article)) activity.isEligibleForSearch = true activity.isEligibleForPrediction = false - activity.persistentIdentifier = ActivityManager.identifer(for: article) updateReadArticleSearchAttributes(with: article) #endif