diff --git a/Podfile b/Podfile index 569a758738fa..bbf1186d7242 100644 --- a/Podfile +++ b/Podfile @@ -366,6 +366,18 @@ target 'WordPressHomeWidgetToday' do wordpress_ui end +## Intents +## ============ +## +target 'WordPressIntents' do + project 'WordPress/WordPress.xcodeproj' + + shared_with_all_pods + shared_with_networking_pods + + wordpress_ui +end + ## Notification Content Extension ## ============================== ## diff --git a/Podfile.lock b/Podfile.lock index 280e88f29e5b..c4c6da6987f6 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -769,6 +769,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: dcb2596ad05a63d662e8c7924357babbf327b421 ZIPFoundation: 249fa8890597086cd536bb2df5c9804d84e122b0 -PODFILE CHECKSUM: 03c491ba942789df594bf1665b620af42dff70f2 +PODFILE CHECKSUM: 0539a820471fc9b86c986aafbd49928f8bca86a5 COCOAPODS: 1.9.3 diff --git a/Scripts/fastlane/Fastfile b/Scripts/fastlane/Fastfile index 7cdbd1332ec1..c7e378583fa4 100644 --- a/Scripts/fastlane/Fastfile +++ b/Scripts/fastlane/Fastfile @@ -18,7 +18,8 @@ ALL_BUNDLE_IDENTIFIERS = [ "org.wordpress.WordPressNotificationServiceExtension", "org.wordpress.WordPressNotificationContentExtension", "org.wordpress.WordPressAllTimeWidget", - "org.wordpress.WordPressThisWeekWidget" + "org.wordpress.WordPressThisWeekWidget", + "org.wordpress.WordPressIntents", ] # Use this instead of getting values from ENV directly diff --git a/WordPress/Classes/Stores/StatsInsightsStore.swift b/WordPress/Classes/Stores/StatsInsightsStore.swift index 575297acfb95..15c05c98d954 100644 --- a/WordPress/Classes/Stores/StatsInsightsStore.swift +++ b/WordPress/Classes/Stores/StatsInsightsStore.swift @@ -1013,11 +1013,12 @@ private extension InsightStoreState { } // refresh stats and update any blog info, if they had changed homeWidgetTodayCache[siteID.intValue] = HomeWidgetTodayData(siteID: siteID.intValue, - siteName: blog.title ?? oldData.siteName, - url: blog.url ?? oldData.url, - timeZone: blogService.timeZone(for: blog), - date: Date(), - stats: stats) + siteName: blog.title ?? oldData.siteName, + iconURL: blog.icon ?? oldData.iconURL, + url: blog.url ?? oldData.url, + timeZone: blogService.timeZone(for: blog), + date: Date(), + stats: stats) HomeWidgetTodayData.write(items: homeWidgetTodayCache) WidgetCenter.shared.reloadTimelines(ofKind: WPHomeWidgetTodayKind) @@ -1037,11 +1038,12 @@ private extension InsightStoreState { let timeZone = blogService.timeZone(for: blog) result[blogID.intValue] = HomeWidgetTodayData(siteID: blogID.intValue, - siteName: title, - url: url, - timeZone: timeZone, - date: Date(), - stats: TodayWidgetStats()) + siteName: title, + iconURL: blog.icon, + url: url, + timeZone: timeZone, + date: Date(), + stats: TodayWidgetStats()) } } } diff --git a/WordPress/Classes/Utility/SFHFKeychainUtils.m b/WordPress/Classes/Utility/SFHFKeychainUtils.m index b4ebe3bc07a7..b3f984464390 100755 --- a/WordPress/Classes/Utility/SFHFKeychainUtils.m +++ b/WordPress/Classes/Utility/SFHFKeychainUtils.m @@ -529,4 +529,4 @@ + (BOOL)deleteItemForUsername:(NSString *)username } -@end \ No newline at end of file +@end diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Data/TodayWidgetStats.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Data/TodayWidgetStats.swift index abffc0c5b6fa..c51c4a6e2990 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/Data/TodayWidgetStats.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/Data/TodayWidgetStats.swift @@ -1,3 +1,4 @@ +import CocoaLumberjack import Foundation /// This struct contains data for the Insights Today stats to be displayed in the corresponding widget. diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/iOS 14 Widgets/HomeWidgetCache.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/iOS 14 Widgets/HomeWidgetCache.swift index f05be1e43c14..b8ca43b88446 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/iOS 14 Widgets/HomeWidgetCache.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/iOS 14 Widgets/HomeWidgetCache.swift @@ -1,3 +1,5 @@ +import Foundation + /// Cache manager that stores `HomeWidgetData` values in a plist file, contained in the specified security application group and with the specified file name. /// The corresponding dictionary is always in the form `[Int: T]`, where the `Int` key is the SiteID, and the `T` value is any `HomeWidgetData` instance. struct HomeWidgetCache { diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 0d0b07c69abe..6621ba1ed174 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -421,8 +421,7 @@ 3F526C502538CF2A0069706C /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F526C4F2538CF2A0069706C /* SwiftUI.framework */; }; 3F526C532538CF2A0069706C /* WordPressHomeWidgetToday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F526C522538CF2A0069706C /* WordPressHomeWidgetToday.swift */; }; 3F526C562538CF2B0069706C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3F526C552538CF2B0069706C /* Assets.xcassets */; }; - 3F526C582538CF2B0069706C /* WordPressHomeWidgetToday.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F526C542538CF2A0069706C /* WordPressHomeWidgetToday.intentdefinition */; }; - 3F526C592538CF2B0069706C /* WordPressHomeWidgetToday.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F526C542538CF2A0069706C /* WordPressHomeWidgetToday.intentdefinition */; }; + 3F526C592538CF2B0069706C /* Sites.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F526C542538CF2A0069706C /* Sites.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; }; 3F526C5C2538CF2B0069706C /* WordPressHomeWidgetToday.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 3F526C4C2538CF2A0069706C /* WordPressHomeWidgetToday.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 3F526D572539FAC60069706C /* TodayWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F526D562539FAC60069706C /* TodayWidgetView.swift */; }; 3F5689F0254209790048A9E4 /* TodayWidgetSmallView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F5689EF254209790048A9E4 /* TodayWidgetSmallView.swift */; }; @@ -2188,6 +2187,7 @@ F1450CF52437E1A600A28BFE /* MediaHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1450CF42437E1A600A28BFE /* MediaHost.swift */; }; F1450CF72437E8F800A28BFE /* MediaHostTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1450CF62437E8F800A28BFE /* MediaHostTests.swift */; }; F1450CF92437EEBB00A28BFE /* MediaRequestAuthenticatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1450CF82437EEBB00A28BFE /* MediaRequestAuthenticatorTests.swift */; }; + F1482CE02575BDA4007E4DD6 /* SitesDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1482CDF2575BDA4007E4DD6 /* SitesDataProvider.swift */; }; F15272FD243B27BC00C8DC7A /* AbstractPost+Local.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15272FC243B27BC00C8DC7A /* AbstractPost+Local.swift */; }; F15272FF243B28B700C8DC7A /* RequestAuthenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15272FE243B28B600C8DC7A /* RequestAuthenticator.swift */; }; F1527301243B290E00C8DC7A /* AbstractPost+Autosave.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1527300243B290D00C8DC7A /* AbstractPost+Autosave.swift */; }; @@ -2198,18 +2198,30 @@ F16C35D623F33DE400C81331 /* PageAutoUploadMessageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16C35D523F33DE400C81331 /* PageAutoUploadMessageProvider.swift */; }; F16C35DA23F3F76C00C81331 /* PostAutoUploadMessageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16C35D923F3F76C00C81331 /* PostAutoUploadMessageProvider.swift */; }; F16C35DC23F3F78E00C81331 /* AutoUploadMessageProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16C35DB23F3F78E00C81331 /* AutoUploadMessageProvider.swift */; }; + F17196FC257556020051AA98 /* HomeWidgetTodayData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FB34ACA25672A90001A74A6 /* HomeWidgetTodayData.swift */; }; + F177986725755F2200AD3836 /* SFHFKeychainUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 292CECFF1027259000BD407D /* SFHFKeychainUtils.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; F17A2A1E23BFBD72001E96AC /* UIView+ExistingConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = F17A2A1D23BFBD72001E96AC /* UIView+ExistingConstraints.swift */; }; F17A2A2023BFBD84001E96AC /* UIView+ExistingConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = F17A2A1F23BFBD84001E96AC /* UIView+ExistingConstraints.swift */; }; F1863716253E49B8003D4BEF /* AddSiteAlertFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1863715253E49B8003D4BEF /* AddSiteAlertFactory.swift */; }; F18B43781F849F580089B817 /* PostAttachmentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F18B43771F849F580089B817 /* PostAttachmentTests.swift */; }; F19153BD2549ED0800629EC4 /* UITextField+WorkaroundContinueIssue.swift in Sources */ = {isa = PBXBuildFile; fileRef = F19153BC2549ED0800629EC4 /* UITextField+WorkaroundContinueIssue.swift */; }; + F198FF3B256D47AB001266EB /* HomeWidgetData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F6DA04025646F96002AB88F /* HomeWidgetData.swift */; }; + F198FF4C256D483D001266EB /* TodayWidgetStats.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98E58A2E2360D23400E5534B /* TodayWidgetStats.swift */; }; + F198FF5D256D4877001266EB /* HomeWidgetCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FA53E9B256571D800F4D9A2 /* HomeWidgetCache.swift */; }; + F1ACDF6B256D6C120005AE9B /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 938CF3DB1EF1BE6800AF838E /* CocoaLumberjack.swift */; }; + F1ACDF7C256D6C290005AE9B /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = B5CC05F51962150600975CAC /* Constants.m */; }; F1ADCAF7241FEF0C00F150D2 /* AtomicAuthenticationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1ADCAF6241FEF0C00F150D2 /* AtomicAuthenticationService.swift */; }; F1B1E7A324098FA100549E2A /* BlogTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1B1E7A224098FA100549E2A /* BlogTests.swift */; }; + F1CBEB2A256F122A0031EBBC /* AppImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 433840C622C2BA5B00CB13F8 /* AppImages.xcassets */; }; F1D690161F82913F00200E30 /* FeatureFlag.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D690151F828FF000200E30 /* FeatureFlag.swift */; }; F1D690171F82914200200E30 /* BuildConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1D690141F828FF000200E30 /* BuildConfiguration.swift */; }; F1DB8D292288C14400906E2F /* Uploader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1DB8D282288C14400906E2F /* Uploader.swift */; }; F1DB8D2B2288C24500906E2F /* UploadsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1DB8D2A2288C24500906E2F /* UploadsManager.swift */; }; F1F083F6241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F083F5241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift */; }; + F1F163C125658B4D003DC13B /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F163C025658B4D003DC13B /* IntentHandler.swift */; }; + F1F163D625658B4D003DC13B /* WordPressIntents.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F1F163BE25658B4D003DC13B /* WordPressIntents.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + F1F1643125658B83003DC13B /* Sites.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F526C542538CF2A0069706C /* Sites.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; }; + F1F1643225658B88003DC13B /* Sites.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F526C542538CF2A0069706C /* Sites.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; }; F50B0E7B246212B8006601DD /* NoticeAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F50B0E7A246212B8006601DD /* NoticeAnimator.swift */; }; F511F8A42356A4F400895E73 /* PublishSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F511F8A32356A4F400895E73 /* PublishSettingsViewController.swift */; }; F52CACCA244FA7AA00661380 /* ReaderManageScenePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F52CACC9244FA7AA00661380 /* ReaderManageScenePresenter.swift */; }; @@ -2269,6 +2281,7 @@ F5E6312B243BC83E0088229D /* FilterSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5E6312A243BC83E0088229D /* FilterSheetViewController.swift */; }; F5EF481723ABCAD8004C3532 /* MainShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74337EDC20054D5500777997 /* MainShareViewController.swift */; }; F5EF481823ABCAE0004C3532 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 740C7C4E202F4CD6001C31B0 /* MainInterface.storyboard */; }; + F7951F7A469484D9D9F736D3 /* Pods_WordPressIntents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CA5C9286CDE6B7695CA1A7 /* Pods_WordPressIntents.framework */; }; F913BB0E24B3C58B00C19032 /* EventLoggingDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F913BB0D24B3C58B00C19032 /* EventLoggingDelegate.swift */; }; F913BB1024B3C5CE00C19032 /* EventLoggingDataProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F913BB0F24B3C5CE00C19032 /* EventLoggingDataProvider.swift */; }; F928EDA3226140620030D451 /* WPCrashLoggingProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F928EDA2226140620030D451 /* WPCrashLoggingProvider.swift */; }; @@ -2466,6 +2479,13 @@ remoteGlobalIDString = 1D6058900D05DD3D006BFB54; remoteInfo = WordPress; }; + F1F163D425658B4D003DC13B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = F1F163BD25658B4D003DC13B; + remoteInfo = WordPressIntents; + }; FF2716941CAAC87B0006E2D4 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -2501,6 +2521,7 @@ files = ( 98A3C2FA239997DA0048D38D /* WordPressThisWeekWidget.appex in Embed App Extensions */, 7457667C202B558C00F42E40 /* WordPressDraftActionExtension.appex in Embed App Extensions */, + F1F163D625658B4D003DC13B /* WordPressIntents.appex in Embed App Extensions */, 7358E6BF210BD318002323EB /* WordPressNotificationServiceExtension.appex in Embed App Extensions */, 733F36102126197800988727 /* WordPressNotificationContentExtension.appex in Embed App Extensions */, 98D31B992396ED7F009CFF43 /* WordPressAllTimeWidget.appex in Embed App Extensions */, @@ -2951,7 +2972,7 @@ 3F526C4D2538CF2A0069706C /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; 3F526C4F2538CF2A0069706C /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; 3F526C522538CF2A0069706C /* WordPressHomeWidgetToday.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressHomeWidgetToday.swift; sourceTree = ""; }; - 3F526C542538CF2A0069706C /* WordPressHomeWidgetToday.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = WordPressHomeWidgetToday.intentdefinition; sourceTree = ""; }; + 3F526C542538CF2A0069706C /* Sites.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = Sites.intentdefinition; sourceTree = ""; }; 3F526C552538CF2B0069706C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 3F526C572538CF2B0069706C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3F526D562539FAC60069706C /* TodayWidgetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayWidgetView.swift; sourceTree = ""; }; @@ -3200,6 +3221,7 @@ 4F943DB9A7237917709622D5 /* Pods-WordPressNotificationContentExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressNotificationContentExtension.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressNotificationContentExtension/Pods-WordPressNotificationContentExtension.debug.xcconfig"; sourceTree = ""; }; 51A5F017948878F7E26979A0 /* Pods-WordPress.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPress.release.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPress/Pods-WordPress.release.xcconfig"; sourceTree = ""; }; 556E3A9C1600564F6A3CADF6 /* Pods_WordPress.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPress.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 55CA5C9286CDE6B7695CA1A7 /* Pods_WordPressIntents.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressIntents.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 570265142298921800F2214C /* PostListTableViewHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostListTableViewHandler.swift; sourceTree = ""; }; 570265162298960B00F2214C /* PostListTableViewHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostListTableViewHandlerTests.swift; sourceTree = ""; }; 5703A4C522C003DC0028A343 /* WPStyleGuide+Posts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WPStyleGuide+Posts.swift"; sourceTree = ""; }; @@ -3738,6 +3760,7 @@ 85DA8C4318F3F29A0074C8A4 /* WPAnalyticsTrackerWPCom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WPAnalyticsTrackerWPCom.m; sourceTree = ""; }; 85ED98AA17DFB17200090D0B /* iTunesArtwork@2x */ = {isa = PBXFileReference; lastKnownFileType = file; path = "iTunesArtwork@2x"; sourceTree = ""; }; 85F8E19C1B018698000859BB /* PushAuthenticationServiceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PushAuthenticationServiceTests.swift; sourceTree = ""; }; + 8A21014FBE43ADE551F4ECB4 /* Pods-WordPressIntents.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressIntents.release-alpha.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressIntents/Pods-WordPressIntents.release-alpha.xcconfig"; sourceTree = ""; }; 8B0570D2243781100021A436 /* SchedulingCalendarViewController+PresentFrom.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SchedulingCalendarViewController+PresentFrom.swift"; sourceTree = ""; }; 8B05D29023A9417E0063B9AA /* WPMediaEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WPMediaEditor.swift; sourceTree = ""; }; 8B05D29223AA572A0063B9AA /* GutenbergMediaEditorImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergMediaEditorImage.swift; sourceTree = ""; }; @@ -4139,6 +4162,7 @@ 9F8E38BD209C6DE200454E3C /* NotificationSiteSubscriptionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSiteSubscriptionViewController.swift; sourceTree = ""; }; A01C542D0E24E88400D411F2 /* SystemConfiguration.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; A01C55470E25E0D000D411F2 /* defaultPostTemplate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = defaultPostTemplate.html; path = Resources/HTML/defaultPostTemplate.html; sourceTree = ""; }; + A0D83E08D5D2573348DE8926 /* Pods-WordPressIntents.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressIntents.release-internal.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressIntents/Pods-WordPressIntents.release-internal.xcconfig"; sourceTree = ""; }; A0E293EF0E21027E00C6919C /* WPAddPostCategoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WPAddPostCategoryViewController.h; sourceTree = ""; }; A0E293F00E21027E00C6919C /* WPAddPostCategoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = WPAddPostCategoryViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; A20971B419B0BC390058F395 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = ""; }; @@ -4151,6 +4175,7 @@ AC6024D92F44AE4CB4A8C1B3 /* Pods-WordPressScreenshotGeneration.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressScreenshotGeneration.release-alpha.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressScreenshotGeneration/Pods-WordPressScreenshotGeneration.release-alpha.xcconfig"; sourceTree = ""; }; ACBAB5FC0E121C7300F38795 /* PostSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PostSettingsViewController.h; sourceTree = ""; usesTabs = 0; }; ACBAB5FD0E121C7300F38795 /* PostSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PostSettingsViewController.m; sourceTree = ""; usesTabs = 0; }; + ADE06D6829F9044164BBA5AB /* Pods-WordPressIntents.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressIntents.release.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressIntents/Pods-WordPressIntents.release.xcconfig"; sourceTree = ""; }; ADF544C0195A0F620092213D /* CustomHighlightButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomHighlightButton.h; sourceTree = ""; }; ADF544C1195A0F620092213D /* CustomHighlightButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomHighlightButton.m; sourceTree = ""; }; B03B9233250BC593000A40AF /* SuggestionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionService.swift; sourceTree = ""; }; @@ -4431,6 +4456,7 @@ CF343E897B9953453334768C /* Pods-WordPressHomeWidgetToday.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressHomeWidgetToday.release.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressHomeWidgetToday/Pods-WordPressHomeWidgetToday.release.xcconfig"; sourceTree = ""; }; D1216A69ECC61E7772AB8C41 /* Pods-WordPressThisWeekWidget.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressThisWeekWidget.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressThisWeekWidget/Pods-WordPressThisWeekWidget.debug.xcconfig"; sourceTree = ""; }; D61CEAC1CB25AE65B26BDC68 /* Pods-WordPressShareExtension.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressShareExtension.release-alpha.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressShareExtension/Pods-WordPressShareExtension.release-alpha.xcconfig"; sourceTree = ""; }; + D67306CD28F2440FF6B0065C /* Pods-WordPressIntents.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressIntents.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressIntents/Pods-WordPressIntents.debug.xcconfig"; sourceTree = ""; }; D800D86320997BA100E7C7E5 /* ReaderMenuItemCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderMenuItemCreator.swift; sourceTree = ""; }; D800D86520997C6E00E7C7E5 /* FollowingMenuItemCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FollowingMenuItemCreator.swift; sourceTree = ""; }; D800D86720997D5000E7C7E5 /* DiscoverMenuItemCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoverMenuItemCreator.swift; sourceTree = ""; }; @@ -4981,10 +5007,12 @@ F127FFD724213B5600B9D41A /* atomic-get-authentication-cookie-success.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "atomic-get-authentication-cookie-success.json"; sourceTree = ""; }; F12E500223C7C5330068CB5E /* WKWebView+UserAgent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WKWebView+UserAgent.swift"; sourceTree = ""; }; F12FA5D82428FA8F0054DA21 /* AuthenticationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationService.swift; sourceTree = ""; }; + F13E7FDD2566B0AB007D420A /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; }; F1450CF22437DA3E00A28BFE /* MediaRequestAuthenticator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaRequestAuthenticator.swift; sourceTree = ""; }; F1450CF42437E1A600A28BFE /* MediaHost.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaHost.swift; sourceTree = ""; }; F1450CF62437E8F800A28BFE /* MediaHostTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaHostTests.swift; sourceTree = ""; }; F1450CF82437EEBB00A28BFE /* MediaRequestAuthenticatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaRequestAuthenticatorTests.swift; sourceTree = ""; }; + F1482CDF2575BDA4007E4DD6 /* SitesDataProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SitesDataProvider.swift; sourceTree = ""; }; F14B5F70208E648200439554 /* WordPress.debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WordPress.debug.xcconfig; sourceTree = ""; }; F14B5F71208E648200439554 /* WordPress.release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WordPress.release.xcconfig; sourceTree = ""; }; F14B5F72208E648300439554 /* WordPress.internal.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WordPress.internal.xcconfig; sourceTree = ""; }; @@ -5005,6 +5033,10 @@ F1863715253E49B8003D4BEF /* AddSiteAlertFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddSiteAlertFactory.swift; sourceTree = ""; }; F18B43771F849F580089B817 /* PostAttachmentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PostAttachmentTests.swift; path = Posts/PostAttachmentTests.swift; sourceTree = ""; }; F19153BC2549ED0800629EC4 /* UITextField+WorkaroundContinueIssue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+WorkaroundContinueIssue.swift"; sourceTree = ""; }; + F198FF6E256D4914001266EB /* WordPressIntents.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WordPressIntents.entitlements; sourceTree = ""; }; + F198FF7F256D498A001266EB /* WordPressIntentsRelease-Internal.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "WordPressIntentsRelease-Internal.entitlements"; sourceTree = ""; }; + F198FFB1256D4AB2001266EB /* WordPressIntentsRelease-Alpha.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "WordPressIntentsRelease-Alpha.entitlements"; sourceTree = ""; }; + F1ACDF4A256D6B2B0005AE9B /* WordPressIntents-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WordPressIntents-Bridging-Header.h"; sourceTree = ""; }; F1ADCAF6241FEF0C00F150D2 /* AtomicAuthenticationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtomicAuthenticationService.swift; sourceTree = ""; }; F1B1E7A224098FA100549E2A /* BlogTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogTests.swift; sourceTree = ""; }; F1BBA95E243BEFC500E9E5E6 /* WordPress 95.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 95.xcdatamodel"; sourceTree = ""; }; @@ -5013,6 +5045,10 @@ F1DB8D282288C14400906E2F /* Uploader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Uploader.swift; sourceTree = ""; }; F1DB8D2A2288C24500906E2F /* UploadsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadsManager.swift; sourceTree = ""; }; F1F083F5241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtomicAuthenticationServiceTests.swift; sourceTree = ""; }; + F1F163BE25658B4D003DC13B /* WordPressIntents.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WordPressIntents.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + F1F163C025658B4D003DC13B /* IntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentHandler.swift; sourceTree = ""; }; + F1F163C225658B4D003DC13B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F1F163C825658B4D003DC13B /* IntentsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IntentsUI.framework; path = System/Library/Frameworks/IntentsUI.framework; sourceTree = SDKROOT; }; F262DFCA1F94418CE76D1D78 /* Pods-WordPressNotificationContentExtension.release-internal.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressNotificationContentExtension.release-internal.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressNotificationContentExtension/Pods-WordPressNotificationContentExtension.release-internal.xcconfig"; sourceTree = ""; }; F373612EEEEF10E500093FF3 /* Pods-WordPress.release-alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPress.release-alpha.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPress/Pods-WordPress.release-alpha.xcconfig"; sourceTree = ""; }; F47DB4A8EC2E6844E213A3FA /* Pods_WordPressShareExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressShareExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -5322,6 +5358,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F1F163BB25658B4D003DC13B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F7951F7A469484D9D9F736D3 /* Pods_WordPressIntents.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FF27168C1CAAC87A0006E2D4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -5785,6 +5829,7 @@ 98A3C2EF239997DA0048D38D /* WordPressThisWeekWidget.appex */, 98D31B8E2396ED7E009CFF43 /* WordPressAllTimeWidget.appex */, 3F526C4C2538CF2A0069706C /* WordPressHomeWidgetToday.appex */, + F1F163BE25658B4D003DC13B /* WordPressIntents.appex */, ); name = Products; sourceTree = ""; @@ -5837,6 +5882,7 @@ 98D31B902396ED7F009CFF43 /* WordPressAllTimeWidget */, 98A3C2F1239997DA0048D38D /* WordPressThisWeekWidget */, 3F526C512538CF2A0069706C /* WordPressHomeWidgetToday */, + F1F163BF25658B4D003DC13B /* WordPressIntents */, E16AB92F14D978240047A2E5 /* WordPressTest */, FF2716901CAAC87B0006E2D4 /* WordPressUITests */, 8511CFB71C607A7000B7CEED /* WordPressScreenshotGeneration */, @@ -5891,6 +5937,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + F13E7FDD2566B0AB007D420A /* Intents.framework */, FF4DEAD7244B56E200ACA032 /* CoreServices.framework */, 9884B145236225230021D8E9 /* WordPressUI.framework */, 9884B143236224F80021D8E9 /* WordPressUI.framework */, @@ -5961,6 +6008,8 @@ 3F526C4D2538CF2A0069706C /* WidgetKit.framework */, 3F526C4F2538CF2A0069706C /* SwiftUI.framework */, 98732547FFA87FB104C3C6E6 /* Pods_WordPressHomeWidgetToday.framework */, + F1F163C825658B4D003DC13B /* IntentsUI.framework */, + 55CA5C9286CDE6B7695CA1A7 /* Pods_WordPressIntents.framework */, ); name = Frameworks; sourceTree = ""; @@ -6508,7 +6557,6 @@ isa = PBXGroup; children = ( 3F526C572538CF2B0069706C /* Info.plist */, - 3F526C542538CF2A0069706C /* WordPressHomeWidgetToday.intentdefinition */, 24D40492253F6D01002843AC /* WordPressHomeWidgetToday.entitlements */, 3F015D7F253F9CDB00991CCB /* WordPressHomeWidgetTodayRelease-Alpha.entitlements */, 24D40491253F6CEE002843AC /* WordPressHomeWidgetTodayRelease-Internal.entitlements */, @@ -9499,6 +9547,10 @@ CF343E897B9953453334768C /* Pods-WordPressHomeWidgetToday.release.xcconfig */, 0A27D496128FBCDFA3658994 /* Pods-WordPressHomeWidgetToday.release-internal.xcconfig */, FEF93A01F06919BDB9486A8E /* Pods-WordPressHomeWidgetToday.release-alpha.xcconfig */, + D67306CD28F2440FF6B0065C /* Pods-WordPressIntents.debug.xcconfig */, + ADE06D6829F9044164BBA5AB /* Pods-WordPressIntents.release.xcconfig */, + A0D83E08D5D2573348DE8926 /* Pods-WordPressIntents.release-internal.xcconfig */, + 8A21014FBE43ADE551F4ECB4 /* Pods-WordPressIntents.release-alpha.xcconfig */, ); name = Pods; sourceTree = ""; @@ -10978,6 +11030,18 @@ name = Editor; sourceTree = ""; }; + F198FFB2256D4AB7001266EB /* Supporting Files */ = { + isa = PBXGroup; + children = ( + F1F163C225658B4D003DC13B /* Info.plist */, + F198FFB1256D4AB2001266EB /* WordPressIntentsRelease-Alpha.entitlements */, + F198FF7F256D498A001266EB /* WordPressIntentsRelease-Internal.entitlements */, + F198FF6E256D4914001266EB /* WordPressIntents.entitlements */, + F1ACDF4A256D6B2B0005AE9B /* WordPressIntents-Bridging-Header.h */, + ); + path = "Supporting Files"; + sourceTree = ""; + }; F1D690131F828FF000200E30 /* BuildInformation */ = { isa = PBXGroup; children = ( @@ -10997,6 +11061,17 @@ path = Uploads; sourceTree = ""; }; + F1F163BF25658B4D003DC13B /* WordPressIntents */ = { + isa = PBXGroup; + children = ( + F1F163C025658B4D003DC13B /* IntentHandler.swift */, + F1482CDF2575BDA4007E4DD6 /* SitesDataProvider.swift */, + 3F526C542538CF2A0069706C /* Sites.intentdefinition */, + F198FFB2256D4AB7001266EB /* Supporting Files */, + ); + path = WordPressIntents; + sourceTree = ""; + }; F53FF3A623EA722F001AD596 /* Detail Header */ = { isa = PBXGroup; children = ( @@ -11208,6 +11283,7 @@ 98A3C2F9239997DA0048D38D /* PBXTargetDependency */, 98D31B982396ED7F009CFF43 /* PBXTargetDependency */, 3F526C5B2538CF2B0069706C /* PBXTargetDependency */, + F1F163D525658B4D003DC13B /* PBXTargetDependency */, ); name = WordPress; productName = WordPress; @@ -11404,6 +11480,25 @@ productReference = E16AB92A14D978240047A2E5 /* WordPressTest.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + F1F163BD25658B4D003DC13B /* WordPressIntents */ = { + isa = PBXNativeTarget; + buildConfigurationList = F1F163DC25658B4D003DC13B /* Build configuration list for PBXNativeTarget "WordPressIntents" */; + buildPhases = ( + CE51D1C75430FDDD21B27F64 /* [CP] Check Pods Manifest.lock */, + F1F163BA25658B4D003DC13B /* Sources */, + F1F163BB25658B4D003DC13B /* Frameworks */, + F1F163BC25658B4D003DC13B /* Resources */, + 2ACEBC2718E9AC320D2B2858 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WordPressIntents; + productName = WordPressIntents; + productReference = F1F163BE25658B4D003DC13B /* WordPressIntents.appex */; + productType = "com.apple.product-type.app-extension"; + }; FF27168E1CAAC87A0006E2D4 /* WordPressUITests */ = { isa = PBXNativeTarget; buildConfigurationList = FF27169A1CAAC87B0006E2D4 /* Build configuration list for PBXNativeTarget "WordPressUITests" */; @@ -11430,7 +11525,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1200; + LastSwiftUpdateCheck = 1220; LastUpgradeCheck = 0930; ORGANIZATIONNAME = WordPress; TargetAttributes = { @@ -11547,6 +11642,10 @@ LastSwiftMigration = 1000; TestTargetID = 1D6058900D05DD3D006BFB54; }; + F1F163BD25658B4D003DC13B = { + CreatedOnToolsVersion = 12.2; + ProvisioningStyle = Manual; + }; FF27168E1CAAC87A0006E2D4 = { CreatedOnToolsVersion = 7.3; DevelopmentTeam = PZYM8XX95Q; @@ -11618,6 +11717,7 @@ 3F526C4B2538CF2A0069706C /* WordPressHomeWidgetToday */, 733F36022126197800988727 /* WordPressNotificationContentExtension */, 7358E6B7210BD318002323EB /* WordPressNotificationServiceExtension */, + F1F163BD25658B4D003DC13B /* WordPressIntents */, E16AB92914D978240047A2E5 /* WordPressTest */, FF27168E1CAAC87A0006E2D4 /* WordPressUITests */, 8511CFB51C607A7000B7CEED /* WordPressScreenshotGeneration */, @@ -12084,6 +12184,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F1F163BC25658B4D003DC13B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F1CBEB2A256F122A0031EBBC /* AppImages.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FF27168D1CAAC87A0006E2D4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -12138,6 +12246,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WordPressHomeWidgetToday/Pods-WordPressHomeWidgetToday-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 2ACEBC2718E9AC320D2B2858 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-WordPressIntents/Pods-WordPressIntents-resources.sh", + "${PODS_ROOT}/FormatterKit/FormatterKit/FormatterKit.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/WordPressShared/WordPressShared.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/WordPressUI/WordPressUIResources.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FormatterKit.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/WordPressShared.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/WordPressUIResources.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WordPressIntents/Pods-WordPressIntents-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 2D007B2B2850683878B2D4F1 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -12636,6 +12766,28 @@ shellPath = /bin/sh; shellScript = "# Close all simulators so on next launch they use the settings below\nxcrun simctl shutdown all\n\n# Disable the hardware keyboard in the simulator\ndefaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false\n"; }; + CE51D1C75430FDDD21B27F64 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-WordPressIntents-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; E00F6488DE2D86BDC84FBB0B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -13485,7 +13637,7 @@ 40E469932017F4070030DB5F /* PluginDirectoryViewController.swift in Sources */, E1D28E931F2F6EB500A5DAFD /* RoleService.swift in Sources */, B5C9401A1DB900DC0079D4FF /* AccountHelper.swift in Sources */, - 3F526C592538CF2B0069706C /* WordPressHomeWidgetToday.intentdefinition in Sources */, + 3F526C592538CF2B0069706C /* Sites.intentdefinition in Sources */, E6E57CD51D0F08B200C22E3E /* ReaderMenuViewController.swift in Sources */, 08D978591CD2AF7D0054F19A /* MenuItemSourceTextBar.m in Sources */, 40E469952017FB1F0030DB5F /* PluginDirectoryViewModel.swift in Sources */, @@ -14100,6 +14252,7 @@ 3F568A0025420DE80048A9E4 /* TodayWidgetMediumView.swift in Sources */, 3F568A2F254216550048A9E4 /* FlexibleCard.swift in Sources */, 3F568A1F254213B60048A9E4 /* VerticalCard.swift in Sources */, + F1F1643125658B83003DC13B /* Sites.intentdefinition in Sources */, 3F526C532538CF2A0069706C /* WordPressHomeWidgetToday.swift in Sources */, 3F1FD27B2548AE900060C53A /* CocoaLumberjack.swift in Sources */, 3F5689F0254209790048A9E4 /* TodayWidgetSmallView.swift in Sources */, @@ -14108,7 +14261,6 @@ 3FB34ACB25672A90001A74A6 /* HomeWidgetTodayData.swift in Sources */, 3FCC8FD9256C911300810295 /* SFHFKeychainUtils.m in Sources */, 3F71D5302548C2B200A4BA93 /* Double+Stats.swift in Sources */, - 3F526C582538CF2B0069706C /* WordPressHomeWidgetToday.intentdefinition in Sources */, 98390AD2254C985F00868F0A /* Tracks.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -14708,6 +14860,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F1F163BA25658B4D003DC13B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F1F1643225658B88003DC13B /* Sites.intentdefinition in Sources */, + F1482CE02575BDA4007E4DD6 /* SitesDataProvider.swift in Sources */, + F17196FC257556020051AA98 /* HomeWidgetTodayData.swift in Sources */, + F1ACDF6B256D6C120005AE9B /* CocoaLumberjack.swift in Sources */, + F198FF5D256D4877001266EB /* HomeWidgetCache.swift in Sources */, + F198FF4C256D483D001266EB /* TodayWidgetStats.swift in Sources */, + F198FF3B256D47AB001266EB /* HomeWidgetData.swift in Sources */, + F1ACDF7C256D6C290005AE9B /* Constants.m in Sources */, + F177986725755F2200AD3836 /* SFHFKeychainUtils.m in Sources */, + F1F163C125658B4D003DC13B /* IntentHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; FF27168B1CAAC87A0006E2D4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -14823,6 +14992,11 @@ target = 1D6058900D05DD3D006BFB54 /* WordPress */; targetProxy = E16AB93E14D978520047A2E5 /* PBXContainerItemProxy */; }; + F1F163D525658B4D003DC13B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = F1F163BD25658B4D003DC13B /* WordPressIntents */; + targetProxy = F1F163D425658B4D003DC13B /* PBXContainerItemProxy */; + }; FF2716951CAAC87B0006E2D4 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 1D6058900D05DD3D006BFB54 /* WordPress */; @@ -17548,6 +17722,192 @@ }; name = Release; }; + F1F163DD25658B4D003DC13B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D67306CD28F2440FF6B0065C /* Pods-WordPressIntents.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = "WordPressIntents/Supporting Files/WordPressIntents.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = PZYM8XX95Q; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + "WPCOM_SCHEME=\\@\\\"${WPCOM_SCHEME}\\\"", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "WordPressIntents/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.WordPressIntents; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "WordPress Intents Extension Development"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + WPCOM_SCHEME = wpdebug; + }; + name = Debug; + }; + F1F163DE25658B4D003DC13B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ADE06D6829F9044164BBA5AB /* Pods-WordPressIntents.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = "WordPressIntents/Supporting Files/WordPressIntents.entitlements"; + CODE_SIGN_IDENTITY = "Apple Distribution: Automattic, Inc. (PZYM8XX95Q)"; + CODE_SIGN_STYLE = Manual; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = PZYM8XX95Q; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + "WPCOM_SCHEME=\\@\\\"${WPCOM_SCHEME}\\\"", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "WordPressIntents/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.WordPressIntents; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressIntents"; + SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + WPCOM_SCHEME = wordpress; + }; + name = Release; + }; + F1F163DF25658B4D003DC13B /* Release-Internal */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A0D83E08D5D2573348DE8926 /* Pods-WordPressIntents.release-internal.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = "WordPressIntents/Supporting Files/WordPressIntentsRelease-Internal.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Distribution: Automattic, Inc."; + CODE_SIGN_STYLE = Manual; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 99KV9Z6BKV; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + "WPCOM_SCHEME=\\@\\\"${WPCOM_SCHEME}\\\"", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "WordPressIntents/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.internal.WordPressIntents; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.internal.WordPressIntents"; + SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + WPCOM_SCHEME = wpinternal; + }; + name = "Release-Internal"; + }; + F1F163E025658B4D003DC13B /* Release-Alpha */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8A21014FBE43ADE551F4ECB4 /* Pods-WordPressIntents.release-alpha.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = "WordPressIntents/Supporting Files/WordPressIntentsRelease-Alpha.entitlements"; + CODE_SIGN_IDENTITY = "iPhone Distribution: Automattic, Inc."; + CODE_SIGN_STYLE = Manual; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 99KV9Z6BKV; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "COCOAPODS=1", + "WPCOM_SCHEME=\\@\\\"${WPCOM_SCHEME}\\\"", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "WordPressIntents/Supporting Files/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.wordpress.alpha.WordPressIntents; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressIntents"; + SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + WPCOM_SCHEME = wpalpha; + }; + name = "Release-Alpha"; + }; FF2716961CAAC87B0006E2D4 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 27AE66536E0C5378203F9312 /* Pods-WordPressUITests.debug.xcconfig */; @@ -17935,6 +18295,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + F1F163DC25658B4D003DC13B /* Build configuration list for PBXNativeTarget "WordPressIntents" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F1F163DD25658B4D003DC13B /* Debug */, + F1F163DE25658B4D003DC13B /* Release */, + F1F163DF25658B4D003DC13B /* Release-Internal */, + F1F163E025658B4D003DC13B /* Release-Alpha */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; FF27169A1CAAC87B0006E2D4 /* Build configuration list for PBXNativeTarget "WordPressUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPressIntents.xcscheme b/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPressIntents.xcscheme new file mode 100644 index 000000000000..cff1dcbba87d --- /dev/null +++ b/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPressIntents.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WordPress/WordPressHomeWidgetToday/Model/HomeWidgetTodayData.swift b/WordPress/WordPressHomeWidgetToday/Model/HomeWidgetTodayData.swift index 1897a03c24c5..56e649b5d8df 100644 --- a/WordPress/WordPressHomeWidgetToday/Model/HomeWidgetTodayData.swift +++ b/WordPress/WordPressHomeWidgetToday/Model/HomeWidgetTodayData.swift @@ -5,6 +5,7 @@ struct HomeWidgetTodayData: HomeWidgetData { let siteID: Int let siteName: String + let iconURL: String? let url: String let timeZone: TimeZone let date: Date diff --git a/WordPress/WordPressHomeWidgetToday/Remote service/HomeWidgetTodayRemoteService.swift b/WordPress/WordPressHomeWidgetToday/Remote service/HomeWidgetTodayRemoteService.swift index 24fa8f04c621..c212cb69760d 100644 --- a/WordPress/WordPressHomeWidgetToday/Remote service/HomeWidgetTodayRemoteService.swift +++ b/WordPress/WordPressHomeWidgetToday/Remote service/HomeWidgetTodayRemoteService.swift @@ -56,6 +56,7 @@ class HomeWidgetTodayRemoteService { let newWidgetData = HomeWidgetTodayData(siteID: widgetData.siteID, siteName: widgetData.siteName, + iconURL: widgetData.iconURL, url: widgetData.url, timeZone: widgetData.timeZone, date: Date(), diff --git a/WordPress/WordPressHomeWidgetToday/Supporting Files/WordPressHomeWidgetToday.intentdefinition b/WordPress/WordPressHomeWidgetToday/Supporting Files/WordPressHomeWidgetToday.intentdefinition deleted file mode 100644 index bdb404554a00..000000000000 --- a/WordPress/WordPressHomeWidgetToday/Supporting Files/WordPressHomeWidgetToday.intentdefinition +++ /dev/null @@ -1,59 +0,0 @@ - - - - - INEnums - - INIntentDefinitionModelVersion - 1.2 - INIntentDefinitionNamespace - 88xZPY - INIntentDefinitionSystemVersion - 20A294 - INIntentDefinitionToolsBuildVersion - 12A6144 - INIntentDefinitionToolsVersion - 12.0 - INIntents - - - INIntentCategory - information - INIntentDescriptionID - tVvJ9c - INIntentEligibleForWidgets - - INIntentIneligibleForSuggestions - - INIntentName - Configuration - INIntentResponse - - INIntentResponseCodes - - - INIntentResponseCodeName - success - INIntentResponseCodeSuccess - - - - INIntentResponseCodeName - failure - - - - INIntentTitle - Configuration - INIntentTitleID - gpCwrM - INIntentType - Custom - INIntentVerb - View - - - INTypes - - - diff --git a/WordPress/WordPressHomeWidgetToday/Views/TodayWidgetView.swift b/WordPress/WordPressHomeWidgetToday/Views/TodayWidgetView.swift index f8da84f0b911..06cd2f448934 100644 --- a/WordPress/WordPressHomeWidgetToday/Views/TodayWidgetView.swift +++ b/WordPress/WordPressHomeWidgetToday/Views/TodayWidgetView.swift @@ -38,7 +38,6 @@ extension TodayWidgetView { static let visitorsTitle: LocalizedStringKey = "Visitors" static let likesTitle: LocalizedStringKey = "Likes" static let commentsTitle: LocalizedStringKey = "Comments" - } } @@ -46,6 +45,7 @@ struct TodayWidgetView_Previews: PreviewProvider { // TODO - TODAYWIDGET: this has been added here for preview purposes only. static let staticContent = HomeWidgetTodayData(siteID: 0, siteName: "Places you should visit", + iconURL: nil, url: "", timeZone: TimeZone.current, date: Date(), diff --git a/WordPress/WordPressHomeWidgetToday/WordPressHomeWidgetToday.swift b/WordPress/WordPressHomeWidgetToday/WordPressHomeWidgetToday.swift index 544a4b8d2221..e4859e253ec5 100644 --- a/WordPress/WordPressHomeWidgetToday/WordPressHomeWidgetToday.swift +++ b/WordPress/WordPressHomeWidgetToday/WordPressHomeWidgetToday.swift @@ -1,100 +1,109 @@ import WidgetKit import SwiftUI - -struct Provider: TimelineProvider { +struct SiteListProvider: IntentTimelineProvider { let service = HomeWidgetTodayRemoteService() - func placeholder(in context: Context) -> HomeWidgetTodayData { - Constants.staticContent + private var defaultSiteID: Int? { + // TODO - TODAYWIDGET: taking the default site id from user defaults for now. + // This would change if the old widget gets reconfigured to a different site than the default. + // This will be updated with the configuration intent. + UserDefaults(suiteName: WPAppGroupName)?.object(forKey: WPStatsTodayWidgetUserDefaultsSiteIdKey) as? Int } - func getSnapshot(in context: Context, completion: @escaping (HomeWidgetTodayData) -> ()) { - getSnapshotData(completion: completion) + private func widgetData(for siteID: String) -> HomeWidgetTodayData? { + /// - TODO: we should not really be needing to do this conversion. Maybe we can evaluate a better mechanism for site identification. + guard let siteID = Int(siteID) else { + return nil + } + + return HomeWidgetTodayData.read()?[siteID] } - func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { - getTimelineData(completion: completion) + // TODO - TODAYWIDGET: This can serve as static content to display in the preview if no data are yet available + // we should define what to put in here + static let staticContent = HomeWidgetTodayData(siteID: 0, + siteName: "Places you should visit", + iconURL: nil, + url: "", + timeZone: TimeZone.current, + date: Date(), + stats: TodayWidgetStats(views: 5980, + visitors: 4208, + likes: 107, + comments: 5)) + + // refresh interval of the widget, in minutes + static let refreshInterval = 60 + + // minimum elapsed time, in minutes, before new data are fetched from the backend. + static let minElapsedTimeToRefresh = 10 + + func placeholder(in context: Context) -> HomeWidgetTodayData { + Self.staticContent } -} -// MARK: - Widget data -private extension Provider { + func getSnapshot(for configuration: SelectSiteIntent, in context: Context, completion: @escaping (HomeWidgetTodayData) -> Void) { + + guard let site = configuration.site, + let siteIdentifier = site.identifier, + let widgetData = widgetData(for: siteIdentifier) else { - func getSnapshotData(completion: @escaping (HomeWidgetTodayData) -> ()) { + completion(Self.staticContent) + return + } - completion(widgetData ?? Constants.staticContent) + completion(widgetData) } - func getTimelineData(completion: @escaping (Timeline) -> ()) { + func getTimeline(for configuration: SelectSiteIntent, in context: Context, completion: @escaping (Timeline) -> Void) { - let date = Date() - let nextRefreshDate = Calendar.current.date(byAdding: .minute, value: Constants.refreshInterval, to: date) ?? date + /// - TODO: review this guard... it's crazy we'd have to ever show static content. Maybe we need to show an error message? + /// + guard let site = configuration.site, + let siteIdentifier = site.identifier, + let widgetData = widgetData(for: siteIdentifier) else { + + let timeline = Timeline(entries: [Self.staticContent], policy: .never) + completion(timeline) + return + } - var entry = widgetData ?? Constants.staticContent + let date = Date() + let nextRefreshDate = Calendar.current.date(byAdding: .minute, value: Self.refreshInterval, to: date) ?? date + let elapsedTime = abs(Calendar.current.dateComponents([.minute], from: widgetData.date, to: date).minute ?? 0) - let elapsedTime = abs(Calendar.current.dateComponents([.minute], from: entry.date, to: date).minute ?? 0) + let privateCompletion = { (widgetData: HomeWidgetTodayData) in + let timeline = Timeline(entries: [widgetData], policy: .after(nextRefreshDate)) + completion(timeline) + } // if cached data are "too old", refresh them from the backend, otherwise keep them - guard elapsedTime > Constants.minElapsedTimeToRefresh else { + guard elapsedTime > Self.minElapsedTimeToRefresh else { - let timeline = Timeline(entries: [entry], policy: .after(nextRefreshDate)) - completion(timeline) + privateCompletion(widgetData) return } - service.fetchStats(for: entry) { result in + service.fetchStats(for: widgetData) { result in switch result { case .failure(let error): DDLogError("HomeWidgetToday: failed to fetch remote stats. Returned error: \(error.localizedDescription)") + + privateCompletion(widgetData) case .success(let widgetData): DispatchQueue.global().async { // update the item in the local cache - HomeWidgetTodayData.setItem(item: entry) + HomeWidgetTodayData.setItem(item: widgetData) } - entry = widgetData - } - let timeline = Timeline(entries: [entry], policy: .after(nextRefreshDate)) - completion(timeline) + privateCompletion(widgetData) + } } } - - private var defaultSiteID: Int? { - // TODO - TODAYWIDGET: taking the default site id from user defaults for now. - // This would change if the old widget gets reconfigured to a different site than the default. - // This will be updated with the configuration intent. - UserDefaults(suiteName: WPAppGroupName)?.object(forKey: WPStatsTodayWidgetUserDefaultsSiteIdKey) as? Int - } - - private var widgetData: HomeWidgetTodayData? { - // TODO - TODAYWIDGET: we might change this, but for now an ID equal to zero should not return any valid data - HomeWidgetTodayData.read()?[defaultSiteID ?? 0] - } -} - -// MARK: - Constants -private extension Provider { - enum Constants { - // TODO - TODAYWIDGET: This can serve as static content to display in the preview if no data are yet available - // we should define what to put in here - static let staticContent = HomeWidgetTodayData(siteID: 0, - siteName: "Places you should visit", - url: "", - timeZone: TimeZone.current, - date: Date(), - stats: TodayWidgetStats(views: 5980, - visitors: 4208, - likes: 107, - comments: 5)) - // refresh interval of the widget, in minutes - static let refreshInterval = 60 - // minimum elapsed time, in minutes, before new data are fetched from the backend. - static let minElapsedTimeToRefresh = 10 - } } @@ -102,7 +111,11 @@ private extension Provider { struct WordPressHomeWidgetToday: Widget { var body: some WidgetConfiguration { - StaticConfiguration(kind: WPHomeWidgetTodayKind, provider: Provider()) { entry in + IntentConfiguration( + kind: WPHomeWidgetTodayKind, + intent: SelectSiteIntent.self, + provider: SiteListProvider() + ) { entry in TodayWidgetView(content: entry) } .configurationDisplayName("Today") diff --git a/WordPress/WordPressIntents/IntentHandler.swift b/WordPress/WordPressIntents/IntentHandler.swift new file mode 100644 index 000000000000..d385cc8c0bef --- /dev/null +++ b/WordPress/WordPressIntents/IntentHandler.swift @@ -0,0 +1,28 @@ +import Intents + +class IntentHandler: INExtension, SelectSiteIntentHandling { + + let sitesDataProvider = SitesDataProvider() + + // MARK: - INIntentHandlerProviding + + override func handler(for intent: INIntent) -> Any { + return self + } + + // MARK: - SelectSiteIntentHandling + + func defaultSite(for intent: SelectSiteIntent) -> Site? { + return sitesDataProvider.defaultSite + } + + func resolveSite(for intent: SelectSiteIntent, with completion: @escaping (SiteResolutionResult) -> Void) { + /// - TODO: I have to test if this method can be called by interacting with Siri, and define an implementation. This is probably called whenever you ask the selected site, since the value can theoretically be requested through Siri. Check out Widgets.intentdefinition. + } + + func provideSiteOptionsCollection(for intent: SelectSiteIntent, with completion: @escaping (INObjectCollection?, Error?) -> Void) { + let sitesCollection = INObjectCollection(items: sitesDataProvider.sites) + + completion(sitesCollection, nil) + } +} diff --git a/WordPress/WordPressIntents/Sites.intentdefinition b/WordPress/WordPressIntents/Sites.intentdefinition new file mode 100644 index 000000000000..b9af4ed46436 --- /dev/null +++ b/WordPress/WordPressIntents/Sites.intentdefinition @@ -0,0 +1,191 @@ + + + + + INEnums + + INIntentDefinitionModelVersion + 1.2 + INIntentDefinitionNamespace + 88xZPY + INIntentDefinitionSystemVersion + 20B29 + INIntentDefinitionToolsBuildVersion + 12B45b + INIntentDefinitionToolsVersion + 12.2 + INIntents + + + INIntentCategory + information + INIntentDescriptionID + tVvJ9c + INIntentEligibleForWidgets + + INIntentIneligibleForSuggestions + + INIntentLastParameterTag + 2 + INIntentName + SelectSite + INIntentParameters + + + INIntentParameterConfigurable + + INIntentParameterCustomDisambiguation + + INIntentParameterDisplayName + Site + INIntentParameterDisplayNameID + ILcGmf + INIntentParameterDisplayPriority + 1 + INIntentParameterName + site + INIntentParameterObjectType + Site + INIntentParameterObjectTypeNamespace + 88xZPY + INIntentParameterPromptDialogs + + + INIntentParameterPromptDialogCustom + + INIntentParameterPromptDialogType + Configuration + + + INIntentParameterPromptDialogCustom + + INIntentParameterPromptDialogType + Primary + + + INIntentParameterPromptDialogCustom + + INIntentParameterPromptDialogFormatString + There are ${count} options matching ‘${site}’. + INIntentParameterPromptDialogFormatStringID + BOl9KQ + INIntentParameterPromptDialogType + DisambiguationIntroduction + + + INIntentParameterPromptDialogCustom + + INIntentParameterPromptDialogFormatString + Just to confirm, you wanted ‘${site}’? + INIntentParameterPromptDialogFormatStringID + s4dJhx + INIntentParameterPromptDialogType + Confirmation + + + INIntentParameterSupportsDynamicEnumeration + + INIntentParameterSupportsResolution + + INIntentParameterTag + 2 + INIntentParameterType + Object + + + INIntentResponse + + INIntentResponseCodes + + + INIntentResponseCodeName + success + INIntentResponseCodeSuccess + + + + INIntentResponseCodeName + failure + + + INIntentResponseLastParameterTag + 2 + + INIntentTitle + Select Site + INIntentTitleID + gpCwrM + INIntentType + Custom + INIntentVerb + View + + + INTypes + + + INTypeDisplayName + Site + INTypeDisplayNameID + cyajMn + INTypeLastPropertyTag + 100 + INTypeName + Site + INTypeProperties + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 1 + INTypePropertyName + identifier + INTypePropertyTag + 1 + INTypePropertyType + String + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 2 + INTypePropertyName + displayString + INTypePropertyTag + 2 + INTypePropertyType + String + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 3 + INTypePropertyName + pronunciationHint + INTypePropertyTag + 3 + INTypePropertyType + String + + + INTypePropertyDefault + + INTypePropertyDisplayPriority + 4 + INTypePropertyName + alternativeSpeakableMatches + INTypePropertySupportsMultipleValues + + INTypePropertyTag + 4 + INTypePropertyType + SpeakableString + + + + + + diff --git a/WordPress/WordPressIntents/SitesDataProvider.swift b/WordPress/WordPressIntents/SitesDataProvider.swift new file mode 100644 index 000000000000..fb7cd37d50e3 --- /dev/null +++ b/WordPress/WordPressIntents/SitesDataProvider.swift @@ -0,0 +1,75 @@ +import Intents + +class SitesDataProvider { + private(set) var sites = [Site]() + + init() { + initializeSites() + } + + // MARK: - Init Support + + private func initializeSites() { + guard let data = HomeWidgetTodayData.read() else { + sites = [] + return + } + + sites = data.map { (key: Int, data: HomeWidgetTodayData) -> Site in + + // Note: the image for the site was being set through: + // + // icon(from: data) + // + // Unfortunately, this had to be turned off for now since images aren't working very well in the + // customizer as reported here: https://github.com/wordpress-mobile/WordPress-iOS/pull/15397#pullrequestreview-539474644 + + let siteDomain: String? + + if let urlComponents = URLComponents(string: data.url), + let host = urlComponents.host { + + siteDomain = host + } else { + siteDomain = nil + } + + return Site( + identifier: String(key), + display: data.siteName, + subtitle: siteDomain, + image: nil) + } + } + + // MARK: - Default Site + + private var defaultSiteID: Int? { + // TODO - TODAYWIDGET: taking the default site id from user defaults for now. + // This would change if the old widget gets reconfigured to a different site than the default. + return UserDefaults(suiteName: WPAppGroupName)?.object(forKey: WPStatsTodayWidgetUserDefaultsSiteIdKey) as? Int + } + + var defaultSite: Site? { + guard let defaultSiteID = self.defaultSiteID else { + return nil + } + + return sites.first { site in + return site.identifier == String(defaultSiteID) + } + } + + // MARK: - Site Icons + + private func icon(from data: HomeWidgetTodayData) -> INImage { + guard let iconURL = data.iconURL, + let url = URL(string: iconURL), + let image = INImage(url: url) else { + + return INImage(named: "blavatar-default") + } + + return image + } +} diff --git a/WordPress/WordPressIntents/Supporting Files/Info.plist b/WordPress/WordPressIntents/Supporting Files/Info.plist new file mode 100644 index 000000000000..4c709f9eddac --- /dev/null +++ b/WordPress/WordPressIntents/Supporting Files/Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + WordPressIntents + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + ${VERSION_SHORT} + CFBundleVersion + ${VERSION_LONG} + NSExtension + + NSExtensionAttributes + + IntentsRestrictedWhileLocked + + IntentsRestrictedWhileProtectedDataUnavailable + + IntentsSupported + + SelectSiteIntent + + + NSExtensionPointIdentifier + com.apple.intents-service + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).IntentHandler + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + + diff --git a/WordPress/WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h b/WordPress/WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h new file mode 100644 index 000000000000..4bda21fed193 --- /dev/null +++ b/WordPress/WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h @@ -0,0 +1 @@ +#import "Constants.h" diff --git a/WordPress/WordPressIntents/Supporting Files/WordPressIntents.entitlements b/WordPress/WordPressIntents/Supporting Files/WordPressIntents.entitlements new file mode 100644 index 000000000000..82da242fbdbe --- /dev/null +++ b/WordPress/WordPressIntents/Supporting Files/WordPressIntents.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.org.wordpress + + + diff --git a/WordPress/WordPressIntents/Supporting Files/WordPressIntentsRelease-Alpha.entitlements b/WordPress/WordPressIntents/Supporting Files/WordPressIntentsRelease-Alpha.entitlements new file mode 100644 index 000000000000..008824899c59 --- /dev/null +++ b/WordPress/WordPressIntents/Supporting Files/WordPressIntentsRelease-Alpha.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.org.wordpress.alpha + + + diff --git a/WordPress/WordPressIntents/Supporting Files/WordPressIntentsRelease-Internal.entitlements b/WordPress/WordPressIntents/Supporting Files/WordPressIntentsRelease-Internal.entitlements new file mode 100644 index 000000000000..34c60fc89467 --- /dev/null +++ b/WordPress/WordPressIntents/Supporting Files/WordPressIntentsRelease-Internal.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.org.wordpress.internal + + + diff --git a/WordPress/WordPressIntents/WordPressIntentsDebug.entitlements b/WordPress/WordPressIntents/WordPressIntentsDebug.entitlements new file mode 100644 index 000000000000..2eb7e333a6f6 --- /dev/null +++ b/WordPress/WordPressIntents/WordPressIntentsDebug.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.application-groups + + +