From 18329f4a9903e15be150d53b94cb563b39acb838 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Tue, 9 Aug 2022 16:53:25 -0700 Subject: [PATCH 01/15] IOS-437 Update CI to use latest Xcode everywhere --- .github/workflows/archive-and-upload.yml | 14 +++++++------- .github/workflows/non-drm-build.yml | 6 +++--- .github/workflows/unit-testing.yml | 10 +++++----- Axis-iOS | 2 +- CardCreator-iOS | 2 +- NYPLAEToolkit | 2 +- NYPLAudiobookToolkit | 2 +- .../xcshareddata/swiftpm/Package.resolved | 2 +- audiobook-ios-overdrive | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/archive-and-upload.yml b/.github/workflows/archive-and-upload.yml index 07fb69957..3d66ebf72 100644 --- a/.github/workflows/archive-and-upload.yml +++ b/.github/workflows/archive-and-upload.yml @@ -7,7 +7,7 @@ on: - feature/** jobs: version-check: - runs-on: macOS-12 + runs-on: macOS-latest env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: @@ -20,7 +20,7 @@ jobs: - name: Check Carthage version run: command -v carthage && carthage version - name: Checkout main repo - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: token: ${{ secrets.IOS_DEV_CI_PAT }} - name: Add Private Repo Auth @@ -40,20 +40,20 @@ jobs: simplye_changed: ${{ steps.detectapp.outputs.simplye_changed }} openebooks_changed: ${{ steps.detectapp.outputs.openebooks_changed }} upload-arc: - runs-on: macOS-12 + runs-on: macOS-latest needs: version-check if: needs.version-check.outputs.simplye_changed == '1' || needs.version-check.outputs.openebooks_changed == '1' env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: - - name: Force Xcode 13.3.1 - run: sudo xcode-select -switch /Applications/Xcode_13.1.app + - name: Force latest Xcode #currently 13.2.1 cos 13.3.1 still in beta at github; once ready for prod the Xcode.app symlink will automatically select it + run: ls -la /Applications && sudo xcode-select -switch /Applications/Xcode.app - name: Install Firebase Tools run: npm install -g firebase-tools - name: Check Firebase Tools version run: command -v firebase && firebase --version - name: Checkout main repo and submodules - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: submodules: true token: ${{ secrets.IOS_DEV_CI_PAT }} @@ -70,7 +70,7 @@ jobs: GITHUB_REPO_OWNER: ${{ github.repository_owner }} - name: Checkout Adobe RMSDK if: needs.version-check.outputs.simplye_changed == '1' - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: repository: NYPL-Simplified/DRM-iOS-AdeptConnector token: ${{ secrets.IOS_DEV_CI_PAT }} diff --git a/.github/workflows/non-drm-build.yml b/.github/workflows/non-drm-build.yml index fa9e9d9cb..87fe745bc 100644 --- a/.github/workflows/non-drm-build.yml +++ b/.github/workflows/non-drm-build.yml @@ -3,12 +3,12 @@ on: pull_request: jobs: build: - runs-on: macOS-12 + runs-on: macOS-latest steps: - name: Check available Xcodes run: ls -la /Applications - - name: Force Xcode 13.3.1 - run: sudo xcode-select -switch /Applications/Xcode_13.1.app + - name: Force latest Xcode #currently 13.2.1 cos 13.3.1 still in beta at github; once ready for prod the Xcode.app symlink will automatically select it + run: sudo xcode-select -switch /Applications/Xcode.app - name: Checkout main repo uses: actions/checkout@v2 - name: Set up repo for nonDRM build diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index 5aef7fccd..ea9f6a059 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -3,22 +3,22 @@ on: pull_request: jobs: build-and-test: - runs-on: macOS-12 + runs-on: macOS-latest if: github.event.pull_request.head.repo.full_name == github.repository env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: - - name: Force Xcode 13.3.1 - run: sudo xcode-select -switch /Applications/Xcode_13.1.app + - name: Force latest Xcode #currently 13.2.1 cos 13.3.1 still in beta at github; once ready for prod the Xcode.app symlink will automatically select it + run: ls -la /Applications && sudo xcode-select -switch /Applications/Xcode.app - name: Print System Info run: uname -a - name: Checkout main repo and submodules - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: submodules: true token: ${{ secrets.IOS_DEV_CI_PAT }} - name: Checkout Adobe RMSDK - uses: actions/checkout@v2.3.4 + uses: actions/checkout@v2 with: repository: NYPL-Simplified/DRM-iOS-AdeptConnector token: ${{ secrets.IOS_DEV_CI_PAT }} diff --git a/Axis-iOS b/Axis-iOS index fd257aecc..20ed65bd4 160000 --- a/Axis-iOS +++ b/Axis-iOS @@ -1 +1 @@ -Subproject commit fd257aecc4615a269597774653a0de2e840a30d9 +Subproject commit 20ed65bd482041cf7b7b078b638eca7f8233f1b7 diff --git a/CardCreator-iOS b/CardCreator-iOS index 7ce793519..de066a389 160000 --- a/CardCreator-iOS +++ b/CardCreator-iOS @@ -1 +1 @@ -Subproject commit 7ce793519631a046e3f4dc548bd9bc3cd941f0f7 +Subproject commit de066a3896b1aec7ae54e6fd723ac5c5f5eb0b99 diff --git a/NYPLAEToolkit b/NYPLAEToolkit index 9055eb6d6..c76a33159 160000 --- a/NYPLAEToolkit +++ b/NYPLAEToolkit @@ -1 +1 @@ -Subproject commit 9055eb6d668c805afc747c952029e756942215ec +Subproject commit c76a331599a3133abb654ac8848cf2c0ae4af11b diff --git a/NYPLAudiobookToolkit b/NYPLAudiobookToolkit index 764e6a033..405d60a3f 160000 --- a/NYPLAudiobookToolkit +++ b/NYPLAudiobookToolkit @@ -1 +1 @@ -Subproject commit 764e6a03357acb56d8c39964cdbacaf93de7f4cd +Subproject commit 405d60a3f8ba7c36bfb42eba1e9bd539d8ad576c diff --git a/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d7b4bdfe8..d1da9f79f 100644 --- a/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/NYPL-Simplified/iOS-Utilities", "state": { "branch": "main", - "revision": "39ec99cdfc598da0984a3a51329df41a3e6a7612", + "revision": "ed011c9fa109ed306e9c9d30fd2552aa8bf832fe", "version": null } }, diff --git a/audiobook-ios-overdrive b/audiobook-ios-overdrive index a00e76d7b..77e95e8f9 160000 --- a/audiobook-ios-overdrive +++ b/audiobook-ios-overdrive @@ -1 +1 @@ -Subproject commit a00e76d7b243b3857b74b685b8ef10ed5447c108 +Subproject commit 77e95e8f970bfcda19259b5fb4688a71786315fa From 54f7e7e9946e49bf5ff2109c1c109a78a224549b Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Wed, 10 Aug 2022 10:04:53 -0700 Subject: [PATCH 02/15] IOS-437 Bump build number of both apps --- Simplified.xcodeproj/project.pbxproj | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index afc6cb08f..ae6d7a83a 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5588,7 +5588,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5639,7 +5639,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5689,7 +5689,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5737,7 +5737,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5783,7 +5783,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5831,7 +5831,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -6007,7 +6007,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6058,7 +6058,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 0; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; From d0714e18a5badfa7a907b8353c61749514616740 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Wed, 10 Aug 2022 10:55:25 -0700 Subject: [PATCH 03/15] Update simulator versions to use in CI checks --- scripts/xcode-build-nodrm.sh | 2 +- scripts/xcode-test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/xcode-build-nodrm.sh b/scripts/xcode-build-nodrm.sh index cea6c1e9c..129d452c1 100755 --- a/scripts/xcode-build-nodrm.sh +++ b/scripts/xcode-build-nodrm.sh @@ -17,6 +17,6 @@ echo "Building SimplyE without DRM support..." xcodebuild -project Simplified.xcodeproj \ -scheme SimplyE-noDRM \ - -destination platform=iOS\ Simulator,OS=15.0,name=iPhone\ 13\ Pro\ + -destination platform=iOS\ Simulator,OS=15.2,name=iPhone\ 13\ Pro\ clean build | \ if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index aa4e70a82..d95bc124b 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -22,7 +22,7 @@ echo "Running unit tests for $APP_NAME..." # packages with the version checked in in Package.resolved xcodebuild -project "$PROJECT_NAME" \ -scheme "$SCHEME" \ - -destination platform=iOS\ Simulator,OS=15.0,name=iPhone\ 13 \ + -destination platform=iOS\ Simulator,OS=15.2,name=iPhone\ 13 \ -disableAutomaticPackageResolution \ clean test | \ if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi From 2f82de7704b62f54251854ec0a5a794363078b8d Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Thu, 11 Aug 2022 09:53:05 -0700 Subject: [PATCH 04/15] IOS-436 Update min deployment target to iOS 11 Fix related deprecations and remove dead code. --- Axis-iOS | 2 +- CardCreator-iOS | 2 +- NYPLAEToolkit | 2 +- NYPLAudiobookToolkit | 2 +- RDServices.xcodeproj/project.pbxproj | 4 ++-- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ .../xcshareddata/swiftpm/Package.resolved | 2 +- .../AppInfrastructure/NYPLAppReviewPrompt.swift | 14 ++++++-------- .../AppInfrastructure/NYPLUserNotifications.swift | 2 -- .../Catalog/NYPLCatalogGroupedFeedViewController.m | 7 +++---- .../Catalog/NYPLCatalogSearchViewController.m | 5 +++-- .../NYPLCatalogUngroupedFeedViewController.m | 4 ++-- Simplified/MyBooks/NYPLMyBooksViewController.m | 2 +- .../Reader2/UI/NYPLBaseReaderViewController.swift | 2 +- adept-ios | 2 +- audiobook-ios-overdrive | 2 +- readium-sdk | 2 +- tenprintcover-ios | 2 +- 18 files changed, 33 insertions(+), 37 deletions(-) diff --git a/Axis-iOS b/Axis-iOS index 20ed65bd4..71fe54ff9 160000 --- a/Axis-iOS +++ b/Axis-iOS @@ -1 +1 @@ -Subproject commit 20ed65bd482041cf7b7b078b638eca7f8233f1b7 +Subproject commit 71fe54ff953121d1c6077d661cbb3eeb9c3e01b5 diff --git a/CardCreator-iOS b/CardCreator-iOS index de066a389..720f9d831 160000 --- a/CardCreator-iOS +++ b/CardCreator-iOS @@ -1 +1 @@ -Subproject commit de066a3896b1aec7ae54e6fd723ac5c5f5eb0b99 +Subproject commit 720f9d831231dcfe049278d97d8d3572e910511e diff --git a/NYPLAEToolkit b/NYPLAEToolkit index c76a33159..1b13d97ac 160000 --- a/NYPLAEToolkit +++ b/NYPLAEToolkit @@ -1 +1 @@ -Subproject commit c76a331599a3133abb654ac8848cf2c0ae4af11b +Subproject commit 1b13d97ac266744d8f2acfc8fa5be2cb5da88aa4 diff --git a/NYPLAudiobookToolkit b/NYPLAudiobookToolkit index 405d60a3f..63d406338 160000 --- a/NYPLAudiobookToolkit +++ b/NYPLAudiobookToolkit @@ -1 +1 @@ -Subproject commit 405d60a3f8ba7c36bfb42eba1e9bd539d8ad576c +Subproject commit 63d406338bd90f83695d54862415b716e69aeb7c diff --git a/RDServices.xcodeproj/project.pbxproj b/RDServices.xcodeproj/project.pbxproj index 5451bde97..8f2cc37de 100644 --- a/RDServices.xcodeproj/project.pbxproj +++ b/RDServices.xcodeproj/project.pbxproj @@ -537,7 +537,7 @@ "\"$(NYPLADEPT_ADOBE_SDK)/DRM_Connector_Prerelease/dp/public\"", "\"$(NYPLADEPT_ADOBE_SDK)/DRM_Connector_Prerelease/xml/uft/public\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = NO; @@ -590,7 +590,7 @@ "\"$(NYPLADEPT_ADOBE_SDK)/DRM_Connector_Prerelease/dp/public\"", "\"$(NYPLADEPT_ADOBE_SDK)/DRM_Connector_Prerelease/xml/uft/public\"", ); - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = NO; VALIDATE_PRODUCT = YES; diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index ae6d7a83a..f5376d7aa 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5783,7 +5783,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5831,7 +5831,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5924,7 +5924,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -5984,7 +5984,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -6007,7 +6007,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6058,7 +6058,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d1da9f79f..e92e7d0db 100644 --- a/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Simplified.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,7 +6,7 @@ "repositoryURL": "https://github.com/NYPL-Simplified/iOS-Utilities", "state": { "branch": "main", - "revision": "ed011c9fa109ed306e9c9d30fd2552aa8bf832fe", + "revision": "efa7d8697a76030b30eb017b82830576bae8f84f", "version": null } }, diff --git a/Simplified/AppInfrastructure/NYPLAppReviewPrompt.swift b/Simplified/AppInfrastructure/NYPLAppReviewPrompt.swift index d9e62a32c..b6af02771 100644 --- a/Simplified/AppInfrastructure/NYPLAppReviewPrompt.swift +++ b/Simplified/AppInfrastructure/NYPLAppReviewPrompt.swift @@ -7,15 +7,13 @@ import StoreKit class func presentIfAvailable() { - if #available(iOS 10.3, *) { - var count = UserDefaults.standard.value(forKey: ReviewPromptChecksKey) as? UInt ?? 0 - count += 1 - UserDefaults.standard.setValue(count, forKey: ReviewPromptChecksKey) + var count = UserDefaults.standard.value(forKey: ReviewPromptChecksKey) as? UInt ?? 0 + count += 1 + UserDefaults.standard.setValue(count, forKey: ReviewPromptChecksKey) - // System will limit to 3 requests/yr as of 12/2018 - if (count == 1 || count == 5 || count == 15) { - SKStoreReviewController.requestReview() - } + // System will limit to 3 requests/yr as of 12/2018 + if (count == 1 || count == 5 || count == 15) { + SKStoreReviewController.requestReview() } } } diff --git a/Simplified/AppInfrastructure/NYPLUserNotifications.swift b/Simplified/AppInfrastructure/NYPLUserNotifications.swift index 87d3e0ac3..d235987a3 100644 --- a/Simplified/AppInfrastructure/NYPLUserNotifications.swift +++ b/Simplified/AppInfrastructure/NYPLUserNotifications.swift @@ -4,7 +4,6 @@ let HoldNotificationCategoryIdentifier = "NYPLHoldToReserveNotificationCategory" let CheckOutActionIdentifier = "NYPLCheckOutNotificationAction" let DefaultActionIdentifier = "UNNotificationDefaultActionIdentifier" -@available (iOS 10.0, *) @objcMembers class NYPLUserNotifications: NSObject { private let unCenter = UNUserNotificationCenter.current() @@ -121,7 +120,6 @@ let DefaultActionIdentifier = "UNNotificationDefaultActionIdentifier" } } -@available (iOS 10.0, *) extension NYPLUserNotifications: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, diff --git a/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m b/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m index b91ff91c4..b009445b2 100644 --- a/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m +++ b/Simplified/Catalog/NYPLCatalogGroupedFeedViewController.m @@ -102,8 +102,7 @@ - (void)viewDidLoad [self.view addSubview:self.facetBarView]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeLeading]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeTrailing]; - [self.facetBarView autoPinToTopLayoutGuideOfViewController:self withInset:0.0]; - + [self.facetBarView autoPinEdgeToSuperviewSafeArea:ALEdgeTop]; if(self.feed.openSearchURL) { self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] @@ -132,11 +131,11 @@ - (void)didMoveToParentViewController:(UIViewController *)parent [super didMoveToParentViewController:parent]; if(parent) { - CGFloat top = parent.topLayoutGuide.length; + CGFloat top = self.view.safeAreaInsets.top; if (self.facetBarView.frame.size.height > 0) { top = CGRectGetMaxY(self.facetBarView.frame) + kTableViewInsetAdjustmentWithEntryPoints; } - CGFloat bottom = parent.bottomLayoutGuide.length; + CGFloat bottom = self.view.safeAreaInsets.bottom; UIEdgeInsets insets = UIEdgeInsetsMake(top, 0, bottom, 0); self.tableView.contentInset = insets; diff --git a/Simplified/Catalog/NYPLCatalogSearchViewController.m b/Simplified/Catalog/NYPLCatalogSearchViewController.m index 32e51fa7d..f2d596723 100644 --- a/Simplified/Catalog/NYPLCatalogSearchViewController.m +++ b/Simplified/Catalog/NYPLCatalogSearchViewController.m @@ -121,9 +121,10 @@ - (void)viewWillLayoutSubviews - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; + UIEdgeInsets newInsets = UIEdgeInsetsMake(CGRectGetMaxY(self.facetBarView.frame), 0, - self.bottomLayoutGuide.length, + self.view.safeAreaInsets.bottom, 0); if (!UIEdgeInsetsEqualToEdgeInsets(self.collectionView.contentInset, newInsets)) { self.collectionView.contentInset = newInsets; @@ -300,7 +301,7 @@ - (void)createAndConfigureFacetBarView [self.view addSubview:self.facetBarView]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeLeading]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeTrailing]; - [self.facetBarView autoPinToTopLayoutGuideOfViewController:self withInset:0.0]; + [self.facetBarView autoPinEdgeToSuperviewSafeArea:ALEdgeTop]; } #pragma mark NYPLEntryPointViewDelegate diff --git a/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m b/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m index 4c128ee6a..528565869 100644 --- a/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m +++ b/Simplified/Catalog/NYPLCatalogUngroupedFeedViewController.m @@ -53,7 +53,7 @@ - (UIEdgeInsets)scrollIndicatorInsets { return UIEdgeInsetsMake(CGRectGetMaxY(self.facetBarView.frame), 0, - self.parentViewController.bottomLayoutGuide.length, + self.view.safeAreaInsets.bottom, 0); } @@ -105,7 +105,7 @@ - (void)viewDidLoad [self.view addSubview:self.facetBarView]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeLeading]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeTrailing]; - [self.facetBarView autoPinToTopLayoutGuideOfViewController:self withInset:0.0]; + [self.facetBarView autoPinEdgeToSuperviewSafeArea:ALEdgeTop]; self.collectionViewActivityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; self.collectionViewActivityIndicator.hidden = YES; diff --git a/Simplified/MyBooks/NYPLMyBooksViewController.m b/Simplified/MyBooks/NYPLMyBooksViewController.m index 95ee22b16..50895f12f 100644 --- a/Simplified/MyBooks/NYPLMyBooksViewController.m +++ b/Simplified/MyBooks/NYPLMyBooksViewController.m @@ -136,7 +136,7 @@ - (void)viewDidLoad [self.view addSubview:self.facetBarView]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeLeading]; [self.facetBarView autoPinEdgeToSuperviewEdge:ALEdgeTrailing]; - [self.facetBarView autoPinToTopLayoutGuideOfViewController:self withInset:0.0]; + [self.facetBarView autoPinEdgeToSuperviewSafeArea:ALEdgeTop]; self.instructionsLabel = [[UILabel alloc] initWithFrame:CGRectZero]; self.instructionsLabel.hidden = YES; diff --git a/Simplified/Reader2/UI/NYPLBaseReaderViewController.swift b/Simplified/Reader2/UI/NYPLBaseReaderViewController.swift index 3b52bad83..c3aaf9f5d 100644 --- a/Simplified/Reader2/UI/NYPLBaseReaderViewController.swift +++ b/Simplified/Reader2/UI/NYPLBaseReaderViewController.swift @@ -70,7 +70,7 @@ class NYPLBaseReaderViewController: UIViewController, Loggable { super.init(nibName: nil, bundle: nil) - NotificationCenter.default.addObserver(self, selector: #selector(voiceOverStatusDidChange), name: Notification.Name(UIAccessibilityVoiceOverStatusChanged), object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(voiceOverStatusDidChange), name: UIAccessibility.voiceOverStatusDidChangeNotification, object: nil) } @available(*, unavailable) diff --git a/adept-ios b/adept-ios index fc4167691..34dda53d6 160000 --- a/adept-ios +++ b/adept-ios @@ -1 +1 @@ -Subproject commit fc4167691aee19bb24399cbd594a8551806f28f8 +Subproject commit 34dda53d6ac27bd40d467f1ba58a7fce7b592ec0 diff --git a/audiobook-ios-overdrive b/audiobook-ios-overdrive index 77e95e8f9..a6c607995 160000 --- a/audiobook-ios-overdrive +++ b/audiobook-ios-overdrive @@ -1 +1 @@ -Subproject commit 77e95e8f970bfcda19259b5fb4688a71786315fa +Subproject commit a6c6079955ddfaf2f2fd4f3601dac42f1fbd14be diff --git a/readium-sdk b/readium-sdk index e6198f537..86052a046 160000 --- a/readium-sdk +++ b/readium-sdk @@ -1 +1 @@ -Subproject commit e6198f5376f366ddeaf18367f9d0f8e3d1a44b2b +Subproject commit 86052a046cdd275d2a6cd6b19c42088bf344e8b3 diff --git a/tenprintcover-ios b/tenprintcover-ios index 7b8a4fc7e..99023b7d6 160000 --- a/tenprintcover-ios +++ b/tenprintcover-ios @@ -1 +1 @@ -Subproject commit 7b8a4fc7e7348394e1e4a7630a84b3912089bdde +Subproject commit 99023b7d6653ccd37e1691f4f2e0ca4ceaa3ceae From 3c412baeecb60f9bbd954757bd800e8264ce73fa Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Thu, 11 Aug 2022 11:38:55 -0700 Subject: [PATCH 05/15] Upgrade to Xcode 13.4.1 --- RDServices.xcodeproj/project.pbxproj | 2 +- RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme | 2 +- Simplified.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/Open eBooks.xcscheme | 2 +- .../xcshareddata/xcschemes/SimplyE-R2dev.xcscheme | 2 +- .../xcshareddata/xcschemes/SimplyE-noDRM.xcscheme | 2 +- Simplified.xcodeproj/xcshareddata/xcschemes/SimplyE.xcscheme | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RDServices.xcodeproj/project.pbxproj b/RDServices.xcodeproj/project.pbxproj index 8f2cc37de..aca8a8159 100644 --- a/RDServices.xcodeproj/project.pbxproj +++ b/RDServices.xcodeproj/project.pbxproj @@ -389,7 +389,7 @@ 118A0E201992B3FD00792DDE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1330; + LastUpgradeCheck = 1340; ORGANIZATIONNAME = Readium; }; buildConfigurationList = 118A0E231992B3FD00792DDE /* Build configuration list for PBXProject "RDServices" */; diff --git a/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme b/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme index ae5f258f6..e97e2fa9e 100644 --- a/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme +++ b/RDServices.xcodeproj/xcshareddata/xcschemes/RDServices.xcscheme @@ -1,6 +1,6 @@ Date: Thu, 11 Aug 2022 15:06:57 -0700 Subject: [PATCH 06/15] OE-622 Upgrade to Firebase 9.4 Firebase 9.4 requires at least Xcode 13.3.1, so we have to force `macOS-12` (Monterey) because it's currently still in beta on GitHub Actions. --- .github/workflows/archive-and-upload.yml | 10 ++++--- .github/workflows/non-drm-build.yml | 10 ++++--- .github/workflows/unit-testing.yml | 8 +++-- Cartfile.resolved | 12 ++++---- Simplified.xcodeproj/project.pbxproj | 38 +++++++++++++++--------- Simplified/Logging/Log.swift | 2 +- Simplified/Logging/NYPLErrorLogger.swift | 3 +- scripts/xcode-archive.sh | 4 +++ scripts/xcode-build-nodrm.sh | 2 +- scripts/xcode-test.sh | 2 +- 10 files changed, 56 insertions(+), 35 deletions(-) diff --git a/.github/workflows/archive-and-upload.yml b/.github/workflows/archive-and-upload.yml index 3d66ebf72..48e59b304 100644 --- a/.github/workflows/archive-and-upload.yml +++ b/.github/workflows/archive-and-upload.yml @@ -7,7 +7,7 @@ on: - feature/** jobs: version-check: - runs-on: macOS-latest + runs-on: macOS-12 env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: @@ -40,14 +40,16 @@ jobs: simplye_changed: ${{ steps.detectapp.outputs.simplye_changed }} openebooks_changed: ${{ steps.detectapp.outputs.openebooks_changed }} upload-arc: - runs-on: macOS-latest + runs-on: macOS-12 needs: version-check if: needs.version-check.outputs.simplye_changed == '1' || needs.version-check.outputs.openebooks_changed == '1' env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: - - name: Force latest Xcode #currently 13.2.1 cos 13.3.1 still in beta at github; once ready for prod the Xcode.app symlink will automatically select it - run: ls -la /Applications && sudo xcode-select -switch /Applications/Xcode.app + - name: Check available Xcodes + run: ls -la /Applications | grep Xcode + - name: Force Xcode we use for development + run: sudo xcode-select -switch /Applications/Xcode_13.4.1.app - name: Install Firebase Tools run: npm install -g firebase-tools - name: Check Firebase Tools version diff --git a/.github/workflows/non-drm-build.yml b/.github/workflows/non-drm-build.yml index 87fe745bc..d6d83cd01 100644 --- a/.github/workflows/non-drm-build.yml +++ b/.github/workflows/non-drm-build.yml @@ -3,12 +3,14 @@ on: pull_request: jobs: build: - runs-on: macOS-latest + runs-on: macOS-12 steps: + - name: Print System Info + run: uname -a - name: Check available Xcodes - run: ls -la /Applications - - name: Force latest Xcode #currently 13.2.1 cos 13.3.1 still in beta at github; once ready for prod the Xcode.app symlink will automatically select it - run: sudo xcode-select -switch /Applications/Xcode.app + run: ls -la /Applications | grep Xcode + - name: Force Xcode we use for development + run: sudo xcode-select -switch /Applications/Xcode_13.4.1.app - name: Checkout main repo uses: actions/checkout@v2 - name: Set up repo for nonDRM build diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index ea9f6a059..32dcf75df 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -3,15 +3,17 @@ on: pull_request: jobs: build-and-test: - runs-on: macOS-latest + runs-on: macOS-12 if: github.event.pull_request.head.repo.full_name == github.repository env: GITHUB_TOKEN: ${{ secrets.IOS_DEV_CI_PAT }} steps: - - name: Force latest Xcode #currently 13.2.1 cos 13.3.1 still in beta at github; once ready for prod the Xcode.app symlink will automatically select it - run: ls -la /Applications && sudo xcode-select -switch /Applications/Xcode.app - name: Print System Info run: uname -a + - name: Check available Xcodes + run: ls -la /Applications | grep Xcode + - name: Force Xcode we use for development + run: sudo xcode-select -switch /Applications/Xcode_13.4.1.app - name: Checkout main repo and submodules uses: actions/checkout@v2 with: diff --git a/Cartfile.resolved b/Cartfile.resolved index 5e746485c..205abda89 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,13 +1,13 @@ -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" "8.15.0" -binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json" "8.15.0" +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" "9.4.0" +binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseCrashlyticsBinary.json" "9.4.0" github "NYPL-Simplified/PDFRendererProvider-iOS" "d63e6ba168cb91617a4aca5e306a92af1dd4497c" github "cezheng/Fuzi" "3.1.3" github "dexman/Minizip" "1.4.0" -github "krzyzanowskim/CryptoSwift" "1.4.3" -github "ra1028/DifferenceKit" "1.2.0" +github "krzyzanowskim/CryptoSwift" "1.5.1" +github "ra1028/DifferenceKit" "1.3.0" github "readium/GCDWebServer" "3.7.1" -github "readium/swift-toolkit" "213b4b212de1b7a2198a42b37387d0def3ec22a8" -github "scinfu/SwiftSoup" "2.4.2" +github "readium/swift-toolkit" "5278ddc4c12c69aa6c5946ed4a4e09c0ebf642e3" +github "scinfu/SwiftSoup" "2.4.3" github "stephencelis/SQLite.swift" "0.12.2" github "weichsel/ZIPFoundation" "0.9.11" github "zxingify/zxingify-objc" "3.6.7" diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index decf4f3a7..cf10ec462 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -366,6 +366,10 @@ 731A5B1224621F2B00B5E663 /* NYPLSignInBusinessLogic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 731A5B1124621F2B00B5E663 /* NYPLSignInBusinessLogic.swift */; }; 731B2B25244A2B6E00A7A649 /* R2Shared.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 739E6157244A0F6D00D00301 /* R2Shared.framework */; }; 731B2B27244A2B7100A7A649 /* R2Streamer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 731B2B12244A1D6500A7A649 /* R2Streamer.framework */; }; + 731CA5E028A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 731CA5DF28A465A100ABC8DE /* FirebaseCoreInternal.xcframework */; }; + 731CA5E128A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 731CA5DF28A465A100ABC8DE /* FirebaseCoreInternal.xcframework */; }; + 731CA5E228A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 731CA5DF28A465A100ABC8DE /* FirebaseCoreInternal.xcframework */; }; + 731CA5E328A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 731CA5DF28A465A100ABC8DE /* FirebaseCoreInternal.xcframework */; }; 7320AB36251EBC9900E3F04D /* Date+NYPLAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7384C803242BCE5900D5F960 /* Date+NYPLAdditionsTests.swift */; }; 7320AB3A251EBC9900E3F04D /* NYPLOPDSAcquisitionPathEntry.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2D8790A220129AC400E2763F /* NYPLOPDSAcquisitionPathEntry.xml */; }; 7320AB3B251EBC9900E3F04D /* UpdateCheckNeedsUpdate.json in Resources */ = {isa = PBXBuildFile; fileRef = 2D2B478A1D08FC78007F7764 /* UpdateCheckNeedsUpdate.json */; }; @@ -1970,6 +1974,7 @@ 731A5B1124621F2B00B5E663 /* NYPLSignInBusinessLogic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSignInBusinessLogic.swift; sourceTree = ""; }; 731B2B12244A1D6500A7A649 /* R2Streamer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = R2Streamer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 731B2B18244A1D8600A7A649 /* R2Navigator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = R2Navigator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 731CA5DF28A465A100ABC8DE /* FirebaseCoreInternal.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = FirebaseCoreInternal.xcframework; path = Carthage/Build/FirebaseCoreInternal.xcframework; sourceTree = ""; }; 7320AB48251EBC9900E3F04D /* OpenEbooksTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OpenEbooksTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 7321485928651E4B000DF0F0 /* NYPLSignInModalFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NYPLSignInModalFactory.swift; sourceTree = ""; }; 73225DEA250B471400EF1877 /* NYPLRootTabBarController+OE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NYPLRootTabBarController+OE.swift"; sourceTree = ""; }; @@ -2309,6 +2314,7 @@ 732F0443263376540018A82E /* SwiftSoup.xcframework in Frameworks */, 739E610E244A0D8600D00301 /* SystemConfiguration.framework in Frameworks */, 739E6112244A0D8600D00301 /* UIKit.framework in Frameworks */, + 731CA5E128A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */, 732F0435263374FC0018A82E /* ZIPFoundation.xcframework in Frameworks */, 732F0482263378F00018A82E /* ZXingObjC.xcframework in Frameworks */, 7392E4662788E7AF006F010E /* NYPLCardCreator in Frameworks */, @@ -2367,6 +2373,7 @@ 73EB0B3C25821DF4006BC997 /* SystemConfiguration.framework in Frameworks */, 73EB0B4025821DF4006BC997 /* UIKit.framework in Frameworks */, 732F0484263378F00018A82E /* ZXingObjC.xcframework in Frameworks */, + 731CA5E228A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */, 7392E46A2788E7CB006F010E /* NYPLCardCreator in Frameworks */, 7392E4682788E7CB006F010E /* NYPLAudiobookToolkit in Frameworks */, 739F43A62770FEA5005A8E1F /* NYPLUtilities in Frameworks */, @@ -2387,6 +2394,7 @@ 7347B4BB265EFC7A00E4E386 /* FirebaseCrashlytics.xcframework in Frameworks */, 7347B4BF265EFC7A00E4E386 /* FirebaseCore.xcframework in Frameworks */, 7347B4C3265EFC7A00E4E386 /* FirebaseCoreDiagnostics.xcframework in Frameworks */, + 731CA5E328A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */, 7347B4B7265EFC7A00E4E386 /* FirebaseInstallations.xcframework in Frameworks */, 73FCA37025005BA4001B0C5D /* Foundation.framework in Frameworks */, 732F043D263375520018A82E /* Fuzi.xcframework in Frameworks */, @@ -2404,6 +2412,9 @@ 73FCA35D25005BA4001B0C5D /* MediaPlayer.framework in Frameworks */, 732F0452263376BB0018A82E /* Minizip.xcframework in Frameworks */, 7347B4E0265EFD1300E4E386 /* nanopb.xcframework in Frameworks */, + 7392E46C2788E7D8006F010E /* NYPLAxis in Frameworks */, + 73369F1E27862D6800752ECB /* PureLayout in Frameworks */, + 73F5DE882774EE3200597F1E /* NYPLUtilities in Frameworks */, 732F04712633783B0018A82E /* PDFRendererProvider.xcframework in Frameworks */, 7347B4E8265EFD3C00E4E386 /* PromisesObjC.xcframework in Frameworks */, 73FCA36425005BA4001B0C5D /* QuartzCore.framework in Frameworks */, @@ -2416,9 +2427,6 @@ 73FCA36B25005BA4001B0C5D /* SystemConfiguration.framework in Frameworks */, 73FCA36F25005BA4001B0C5D /* UIKit.framework in Frameworks */, 732F0437263374FC0018A82E /* ZIPFoundation.xcframework in Frameworks */, - 7392E46C2788E7D8006F010E /* NYPLAxis in Frameworks */, - 73369F1E27862D6800752ECB /* PureLayout in Frameworks */, - 73F5DE882774EE3200597F1E /* NYPLUtilities in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2438,8 +2446,8 @@ 73061A78273DDAFE00B50318 /* DifferenceKit.xcframework in Frameworks */, 7347B4A9265EFC1B00E4E386 /* FirebaseAnalytics.xcframework in Frameworks */, 7347B4BC265EFC7A00E4E386 /* FirebaseCore.xcframework in Frameworks */, - 73A1731227ADA7D3005E7BCF /* NYPLAxis in Frameworks */, 7347B4C0265EFC7A00E4E386 /* FirebaseCoreDiagnostics.xcframework in Frameworks */, + 731CA5E028A465A100ABC8DE /* FirebaseCoreInternal.xcframework in Frameworks */, 7347B4B8265EFC7A00E4E386 /* FirebaseCrashlytics.xcframework in Frameworks */, 7347B4B4265EFC7A00E4E386 /* FirebaseInstallations.xcframework in Frameworks */, A823D811192BABA400B55DE2 /* Foundation.framework in Frameworks */, @@ -2460,6 +2468,13 @@ 03B092301E78871A00AD338D /* MediaPlayer.framework in Frameworks */, 732F044E263376BB0018A82E /* Minizip.xcframework in Frameworks */, 7347B4DD265EFD1300E4E386 /* nanopb.xcframework in Frameworks */, + 73A1731227ADA7D3005E7BCF /* NYPLAxis in Frameworks */, + 7392E4602788E752006F010E /* NYPLAudiobookToolkit in Frameworks */, + 73B6E276278665AC0043FA30 /* OverdriveProcessor in Frameworks */, + 731465202786106900027CFA /* PureLayout in Frameworks */, + 7392E4622788E75B006F010E /* NYPLCardCreator in Frameworks */, + 73579046276BE7F2009F1ADF /* NYPLUtilities in Frameworks */, + 73829F4127861584008B2A80 /* NYPLAEToolkit in Frameworks */, 732F046D2633783B0018A82E /* PDFRendererProvider.xcframework in Frameworks */, 7347B4E5265EFD3C00E4E386 /* PromisesObjC.xcframework in Frameworks */, 03B092241E78839D00AD338D /* QuartzCore.framework in Frameworks */, @@ -2473,12 +2488,6 @@ A823D815192BABA400B55DE2 /* UIKit.framework in Frameworks */, 732F0434263374FC0018A82E /* ZIPFoundation.xcframework in Frameworks */, 732F0481263378F00018A82E /* ZXingObjC.xcframework in Frameworks */, - 7392E4602788E752006F010E /* NYPLAudiobookToolkit in Frameworks */, - 73B6E276278665AC0043FA30 /* OverdriveProcessor in Frameworks */, - 731465202786106900027CFA /* PureLayout in Frameworks */, - 7392E4622788E75B006F010E /* NYPLCardCreator in Frameworks */, - 73579046276BE7F2009F1ADF /* NYPLUtilities in Frameworks */, - 73829F4127861584008B2A80 /* NYPLAEToolkit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3540,6 +3549,7 @@ 7347B4A2265EFC1B00E4E386 /* FirebaseAnalytics.xcframework */, 7347B4B2265EFC7A00E4E386 /* FirebaseCore.xcframework */, 7347B4B3265EFC7A00E4E386 /* FirebaseCoreDiagnostics.xcframework */, + 731CA5DF28A465A100ABC8DE /* FirebaseCoreInternal.xcframework */, 7347B4B1265EFC7A00E4E386 /* FirebaseCrashlytics.xcframework */, 7347B4B0265EFC7A00E4E386 /* FirebaseInstallations.xcframework */, A823D810192BABA400B55DE2 /* Foundation.framework */, @@ -5783,7 +5793,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5831,7 +5841,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -6007,7 +6017,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6058,7 +6068,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/Simplified/Logging/Log.swift b/Simplified/Logging/Log.swift index 16c2e2e41..a73f3ed4c 100644 --- a/Simplified/Logging/Log.swift +++ b/Simplified/Logging/Log.swift @@ -1,6 +1,6 @@ import os import Foundation -import Firebase +import FirebaseCrashlytics final class Log: NSObject { static var dateFormatter: DateFormatter = { diff --git a/Simplified/Logging/NYPLErrorLogger.swift b/Simplified/Logging/NYPLErrorLogger.swift index 2ca6d32cf..bccbb981a 100644 --- a/Simplified/Logging/NYPLErrorLogger.swift +++ b/Simplified/Logging/NYPLErrorLogger.swift @@ -5,7 +5,8 @@ import CFNetwork import Foundation -import Firebase +import FirebaseCore +import FirebaseCrashlytics fileprivate let nullString = "null" diff --git a/scripts/xcode-archive.sh b/scripts/xcode-archive.sh index 97b71727a..65bd3bcf6 100755 --- a/scripts/xcode-archive.sh +++ b/scripts/xcode-archive.sh @@ -32,6 +32,10 @@ if [ "$BUILD_CONTEXT" == "ci" ]; then security find-identity -p codesigning -v fi +echo "Current build dir: `pwd`" +echo "Carthage contents:" +ls -la Carthage/Build + # build # Note: xcodebuild creates archive `ARCHIVE_NAME.xcarchive` inside ARCHIVE_DIR # Also note: `-disableAutomaticPackageResolution` is for making sure to always diff --git a/scripts/xcode-build-nodrm.sh b/scripts/xcode-build-nodrm.sh index 129d452c1..cd78edb5d 100755 --- a/scripts/xcode-build-nodrm.sh +++ b/scripts/xcode-build-nodrm.sh @@ -17,6 +17,6 @@ echo "Building SimplyE without DRM support..." xcodebuild -project Simplified.xcodeproj \ -scheme SimplyE-noDRM \ - -destination platform=iOS\ Simulator,OS=15.2,name=iPhone\ 13\ Pro\ + -destination platform=iOS\ Simulator,OS=15.5,name=iPhone\ 13\ Pro\ clean build | \ if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi diff --git a/scripts/xcode-test.sh b/scripts/xcode-test.sh index d95bc124b..b32be0a34 100755 --- a/scripts/xcode-test.sh +++ b/scripts/xcode-test.sh @@ -22,7 +22,7 @@ echo "Running unit tests for $APP_NAME..." # packages with the version checked in in Package.resolved xcodebuild -project "$PROJECT_NAME" \ -scheme "$SCHEME" \ - -destination platform=iOS\ Simulator,OS=15.2,name=iPhone\ 13 \ + -destination platform=iOS\ Simulator,OS=15.5,name=iPhone\ 13 \ -disableAutomaticPackageResolution \ clean test | \ if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi From 9cf07fab7f8f4e47e2335dbc29765d8c1af14747 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Mon, 15 Aug 2022 15:10:52 -0700 Subject: [PATCH 07/15] Improve build documentation --- README.md | 14 +++++++------- scripts/bootstrap-drm.sh | 6 +++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7a385d577..54f04c74b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Consequently, [releases](https://github.com/NYPL-Simplified/Simplified-iOS/relea # System Requirements -- Install Xcode 13.1 in `/Applications`, open it and make sure to install additional components if it asks you. +- Install Xcode 13.4.1 in `/Applications`, open it and make sure to install additional components if it asks you. - Install [Carthage](https://github.com/Carthage/Carthage) 0.38 or newer if you haven't already. Using `brew` is recommended. # Building without DRM support @@ -33,7 +33,7 @@ Open `Simplified.xcodeproj` and build the `SimplyE-noDRM` target. ## Building from Scratch 01. Contact project lead and ensure you have access to all the required private repos. -02. Build the dependencies (typically you'll need to run this only once): +02. Set up the repo and build the dependencies (you'll need to do this only once): ```bash git clone git@github.com:NYPL-Simplified/Simplified-iOS.git cd Simplified-iOS @@ -43,16 +43,16 @@ cd Simplified-iOS ## Building Dependencies Individually -Unless the DRM dependencies change (which is very seldom) you shouldn't need to run the `bootstrap-drm.sh` script more than once. +Unless the DRM dependencies change (which is very seldom) you will not need to run the `bootstrap-drm.sh` script more than once. Regarding the other dependencies, there are leaner / faster ways to rebuild them. -First party dependencies are managed via Swift Package Manager. Most of these dependencies are managed via local Swift packages, given by the git submodules checkouts. They are built automatically when you build the `Simplified` Xcode project targets. +First party dependencies are managed via Swift Package Manager. Most of these dependencies are managed via local Swift packages (with the exception of iOS-Utilities, which is remote), given by the git submodules checkouts. PureLayout is also managed via SPM. They are built automatically when you build the `Simplified` Xcode project targets. -Other 3rd party dependencies are managed via Carthage. To rebuild them you can use the following idempotent script: +All other 3rd party dependencies are managed via Carthage. To rebuild them you can use the following idempotent script: ```bash cd Simplified-iOS #repo root ./scripts/build-dependencies.sh ``` -The `scripts` directory contains a number of other scripts to build dependencies more granularly and also to build/archive/test the app from the command line. These scripts are the same used by our CI system. All these scripts must be run from the root of the Simplified-iOS repo, not from the `scripts` directory. +The `scripts` directory contains a number of other scripts to build dependencies more granularly and also to build/test/archive the app from the command line. These scripts are the same used by our CI system. All these scripts must be run from the root of the Simplified-iOS repo, not from the `scripts` directory. # Building for Readium 2 Integration @@ -92,7 +92,7 @@ Release branch names follow the convention: `release/simplye/` or `rele Feature branch names (for features whose development is a month or more): `feature/`, e.g. `feature/my-new-screen`. -[Continuous integration](https://github.com/NYPL-Simplified/Simplified/wiki/iOS-CI-CD) is enabled on push events on `develop`, release and feature branches. SimplyE device builds are uploaded to Firebase and, for release builds, also to TestFlight. +[Continuous integration](https://github.com/NYPL-Simplified/Simplified/wiki/iOS-CI-CD) is enabled on push events on `develop`, release and feature branches. SimplyE and Open eBooks device builds are uploaded to Firebase and, for release builds, also to TestFlight. # License diff --git a/scripts/bootstrap-drm.sh b/scripts/bootstrap-drm.sh index ad4ad401b..3cdf9a5e0 100755 --- a/scripts/bootstrap-drm.sh +++ b/scripts/bootstrap-drm.sh @@ -4,8 +4,12 @@ # Checks out all dependent repos and sets them up for developing # SimplyE or Open eBooks with DRM support. # +# WARNINGS +# 1. Run this script once on a fresh clone of the Simplified-iOS repo. +# After that, you'll be better off running `build-dependencies.sh` instead. +# 2. This script is not idempotent. +# # USAGE -# You only have to run this script once. # Run it from the root of Simplified-iOS, e.g.: # # ./scripts/bootstrap-drm.sh From 9cb89d4658df7d5ab6978d454f423c743ac8227e Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Thu, 16 Jun 2022 16:23:59 -0700 Subject: [PATCH 08/15] Implement UI for unsubscribe email --- .../NYPLSettingsAccountDetailViewController.m | 63 ++++++++++--------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index c0b05bbe6..bdc20f235 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -34,7 +34,8 @@ typedef NS_ENUM(NSInteger, CellKind) { CellKindPrivacyPolicy, CellKindContentLicense, CellReportIssue, - CellKindDeleteLibraryAccount + CellKindDeleteLibraryAccount, + CellKindUnsubscribeEmail }; typedef NS_ENUM(NSInteger, AccountDetailSection) { @@ -501,7 +502,8 @@ - (void)setupTableData NSMutableArray *section4DeleteAccount = [[NSMutableArray alloc] init]; if ([self.businessLogic isSignedIn]) { - // TODO: iOS-412 Unsubscribe from email + // If statement logic not complete for email unsubcribe + [section4DeleteAccount addObject:@(CellKindUnsubscribeEmail)]; if (self.selectedAccount.supportEmail != nil && [self.selectedAccount.details supportsCardCreator]) { @@ -767,6 +769,16 @@ - (void)tableView:(__attribute__((unused)) UITableView *)tableView #endif [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; break; + case CellKindUnsubscribeEmail: { + [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; + // TODO: Retrieve unsubscribe url + RemoteHTMLViewController *vc = [[RemoteHTMLViewController alloc] + initWithURL:[self.selectedAccount.details getLicenseURL:URLTypeContentLicenses] + title:NSLocalizedString(@"Unsubscribe from emails", nil) + failureMessage:NSLocalizedString(@"The page could not load due to a connection error.", nil)]; + [self.navigationController pushViewController:vc animated:YES]; + break; + } } } } @@ -1097,37 +1109,17 @@ - (UITableViewCell *)tableView:(__attribute__((unused)) UITableView *)tableView return cell; } case CellKindDeleteServerData: { - UITableViewCell *cell = [[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:nil]; - cell.textLabel.font = [UIFont customFontForTextStyle:UIFontTextStyleBody]; #ifdef SIMPLYE - cell.textLabel.text = NSLocalizedString(@"Delete my SimplyE Data", nil); + return [self deletionStyleTableViewCell:NSLocalizedString(@"Delete my SimplyE Data", nil)]; #else - cell.textLabel.text = NSLocalizedString(@"Delete my Open eBooks Data", nil); + return [self deletionStyleTableViewCell:NSLocalizedString(@"Delete my Open eBooks Data", nil)]; #endif - - cell.textLabel.textColor = NYPLConfiguration.deleteActionColor; - - UIImageView *imageView = [self rightArrowImageView]; - imageView.tintColor = NYPLConfiguration.deleteActionColor; - cell.accessoryView = imageView; - - return cell; } case CellKindDeleteLibraryAccount: { - UITableViewCell *cell = [[UITableViewCell alloc] - initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:nil]; - cell.textLabel.font = [UIFont customFontForTextStyle:UIFontTextStyleBody]; - cell.textLabel.text = NSLocalizedString(@"Delete Library Card", nil); - cell.textLabel.textColor = NYPLConfiguration.deleteActionColor; - - UIImageView *imageView = [self rightArrowImageView]; - imageView.tintColor = NYPLConfiguration.deleteActionColor; - cell.accessoryView = imageView; - - return cell; + return [self deletionStyleTableViewCell:NSLocalizedString(@"Delete Library Card", nil)]; + } + case CellKindUnsubscribeEmail: { + return [self deletionStyleTableViewCell:NSLocalizedString(@"Unsubscribe from emails", nil)]; } } } @@ -1147,6 +1139,21 @@ - (UIImageView *)rightArrowImageView { return imageView; } +- (UITableViewCell *)deletionStyleTableViewCell:(NSString *)title { + UITableViewCell *cell = [[UITableViewCell alloc] + initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:nil]; + cell.textLabel.font = [UIFont customFontForTextStyle:UIFontTextStyleBody]; + cell.textLabel.text = title; + cell.textLabel.textColor = NYPLConfiguration.deleteActionColor; + + UIImageView *imageView = [self rightArrowImageView]; + imageView.tintColor = NYPLConfiguration.deleteActionColor; + cell.accessoryView = imageView; + + return cell; +} + - (UITableViewCell *)createRegistrationCell { UIView *containerView = [[UIView alloc] init]; From 7352be073d661296eb10c116c80533c533e91480 Mon Sep 17 00:00:00 2001 From: Ernest Fan Date: Tue, 21 Jun 2022 16:01:46 -0700 Subject: [PATCH 09/15] Update data model and logic for unsubscribe from email --- Simplified/Accounts/Library/Account.swift | 23 +++++++++++++++++++ .../NYPLSettingsAccountDetailViewController.m | 10 ++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Simplified/Accounts/Library/Account.swift b/Simplified/Accounts/Library/Account.swift index 5a8e266be..a38e8cdd4 100644 --- a/Simplified/Accounts/Library/Account.swift +++ b/Simplified/Accounts/Library/Account.swift @@ -185,6 +185,7 @@ class OPDS2SamlIDP: NSObject, Codable { let supportsSimplyESync:Bool let supportsCardCreator:Bool let supportsReservations:Bool + let supportsUnsubscribeEmail:Bool let auths: [Authentication] let mainColor:String? @@ -205,6 +206,7 @@ class OPDS2SamlIDP: NSObject, Codable { fileprivate var urlContentLicenses:URL? fileprivate var urlEULA:URL? fileprivate var urlPrivacyPolicy:URL? + fileprivate var urlUnsubscribeEmail:URL? var eulaIsAccepted:Bool { get { @@ -283,6 +285,11 @@ class OPDS2SamlIDP: NSObject, Codable { supportsCardCreator = false } + urlUnsubscribeEmail = URL.init(string: authenticationDocument.links?.first(where: { $0.rel == "http://librarysimplified.org/rel/email/unsubscribe/options" })?.href ?? "") + // TODO: For Testing, remove when in prod + urlUnsubscribeEmail = URL.init(string: "https://pub.email.nypl.org/manage-subscriptions") + supportsUnsubscribeEmail = urlUnsubscribeEmail != nil + super.init() if let urlString = authenticationDocument.links?.first(where: { $0.rel == "privacy-policy" })?.href, @@ -304,6 +311,10 @@ class OPDS2SamlIDP: NSObject, Codable { let url = URL(string: urlString) { setURL(url, forLicense: .acknowledgements) } + + if let url = urlUnsubscribeEmail { + setURL(url, forLicense: .unsubscribeEmail) + } } func setURL(_ URL: URL, forLicense urlType: URLType) -> Void { @@ -323,6 +334,9 @@ class OPDS2SamlIDP: NSObject, Codable { case .annotations: urlAnnotations = URL setAccountDictionaryKey("urlAnnotations", toValue: URL.absoluteString as AnyObject) + case .unsubscribeEmail: + urlUnsubscribeEmail = URL + setAccountDictionaryKey("urlUnsubscribeEmail", toValue: URL.absoluteString as AnyObject) } } @@ -368,6 +382,14 @@ class OPDS2SamlIDP: NSObject, Codable { guard let result = URL(string: urlString) else { return nil } return result } + case .unsubscribeEmail: + if let url = urlUnsubscribeEmail { + return url + } else { + guard let urlString = getAccountDictionaryKey("urlUnsubscribeEmail") as? String else { return nil } + guard let result = URL(string: urlString) else { return nil } + return result + } } } @@ -530,6 +552,7 @@ extension Account { case eula case privacyPolicy case annotations + case unsubscribeEmail } // MARK: LoginKeyboard diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index bdc20f235..cffa96032 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -501,10 +501,11 @@ - (void)setupTableData #ifdef SIMPLYE NSMutableArray *section4DeleteAccount = [[NSMutableArray alloc] init]; - if ([self.businessLogic isSignedIn]) { - // If statement logic not complete for email unsubcribe + if (self.selectedAccount.details.supportsUnsubscribeEmail) { [section4DeleteAccount addObject:@(CellKindUnsubscribeEmail)]; - + } + + if ([self.businessLogic isSignedIn]) { if (self.selectedAccount.supportEmail != nil && [self.selectedAccount.details supportsCardCreator]) { [section4DeleteAccount addObject:@(CellKindDeleteLibraryAccount)]; @@ -771,9 +772,8 @@ - (void)tableView:(__attribute__((unused)) UITableView *)tableView break; case CellKindUnsubscribeEmail: { [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; - // TODO: Retrieve unsubscribe url RemoteHTMLViewController *vc = [[RemoteHTMLViewController alloc] - initWithURL:[self.selectedAccount.details getLicenseURL:URLTypeContentLicenses] + initWithURL:[self.selectedAccount.details getLicenseURL:URLTypeUnsubscribeEmail] title:NSLocalizedString(@"Unsubscribe from emails", nil) failureMessage:NSLocalizedString(@"The page could not load due to a connection error.", nil)]; [self.navigationController pushViewController:vc animated:YES]; From ae2e96741e198b186bc9201262e7fd6f7533d623 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Thu, 18 Aug 2022 17:49:35 -0700 Subject: [PATCH 10/15] IOS-412 Minor localization fixes --- Simplified/Settings/NYPLSettingsAccountDetailViewController.m | 4 ++-- Simplified/en.lproj/Localizable.strings | 2 +- Simplified/it.lproj/Localizable.strings | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index cffa96032..dad4b239f 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -774,7 +774,7 @@ - (void)tableView:(__attribute__((unused)) UITableView *)tableView [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; RemoteHTMLViewController *vc = [[RemoteHTMLViewController alloc] initWithURL:[self.selectedAccount.details getLicenseURL:URLTypeUnsubscribeEmail] - title:NSLocalizedString(@"Unsubscribe from emails", nil) + title:NSLocalizedString(@"Unsubscribe from Emails", nil) failureMessage:NSLocalizedString(@"The page could not load due to a connection error.", nil)]; [self.navigationController pushViewController:vc animated:YES]; break; @@ -1119,7 +1119,7 @@ - (UITableViewCell *)tableView:(__attribute__((unused)) UITableView *)tableView return [self deletionStyleTableViewCell:NSLocalizedString(@"Delete Library Card", nil)]; } case CellKindUnsubscribeEmail: { - return [self deletionStyleTableViewCell:NSLocalizedString(@"Unsubscribe from emails", nil)]; + return [self deletionStyleTableViewCell:NSLocalizedString(@"Unsubscribe from Emails", nil)]; } } } diff --git a/Simplified/en.lproj/Localizable.strings b/Simplified/en.lproj/Localizable.strings index 247ffff9f..07d9f6a1f 100644 --- a/Simplified/en.lproj/Localizable.strings +++ b/Simplified/en.lproj/Localizable.strings @@ -266,7 +266,7 @@ "Delete all the bookmarks you have saved in the cloud." = "Delete all the bookmarks you have saved in the cloud."; "You have successfully deleted your SimplyE data" = "You have successfully deleted your SimplyE data"; "You have successfully deleted your Open eBooks data" = "You have successfully deleted your Open eBooks data"; -"Unsubscribe from emails" = "Unsubscribe from emails"; +"Unsubscribe from Emails" = "Unsubscribe from Emails"; "E-Mail to cancel your library card" = "E-Mail to cancel your library card"; "If the above link does not work, please email us at" = "If the above link does not work, please email us at"; "Delete Library Card" = "Delete Library Card"; diff --git a/Simplified/it.lproj/Localizable.strings b/Simplified/it.lproj/Localizable.strings index 46d833070..dd7109435 100644 --- a/Simplified/it.lproj/Localizable.strings +++ b/Simplified/it.lproj/Localizable.strings @@ -265,7 +265,7 @@ "Delete all the bookmarks you have saved in the cloud." = "Tutti i segnalibri salvati sul server saranno rimossi."; "You have successfully deleted your SimplyE data" = "I dati del tuo utente SimplyE sono stati rimossi"; "You have successfully deleted your Open eBooks data" = "I dati del tuo utente Open eBooks sono stati rimossi"; -"Unsubscribe from emails" = "Rimuovimi dalle email"; +"Unsubscribe from Emails" = "Rimuovimi dalle email"; "E-Mail to cancel your library card" = "Manda una mail per cancellare la tua tessera"; "If the above link does not work, please email us at" = "Se il link soprastante non funziona, manda una mail a"; "Delete Library Card" = "Cancella la mia tessera"; From ce85c08037fc6d07015ec25fc31129ce0eba8051 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 19 Aug 2022 10:25:20 -0700 Subject: [PATCH 11/15] IOS-412 Rename method that sets relation URLs from auth doc --- Simplified/Accounts/Library/Account.swift | 12 ++++++------ Simplified/Catalog/NYPLCatalogGroupedFeed.m | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Simplified/Accounts/Library/Account.swift b/Simplified/Accounts/Library/Account.swift index a38e8cdd4..1b33d6ceb 100644 --- a/Simplified/Accounts/Library/Account.swift +++ b/Simplified/Accounts/Library/Account.swift @@ -294,30 +294,30 @@ class OPDS2SamlIDP: NSObject, Codable { if let urlString = authenticationDocument.links?.first(where: { $0.rel == "privacy-policy" })?.href, let url = URL(string: urlString) { - setURL(url, forLicense: .privacyPolicy) + setURL(url, forURLType: .privacyPolicy) } if let urlString = authenticationDocument.links?.first(where: { $0.rel == "terms-of-service" })?.href, let url = URL(string: urlString) { - setURL(url, forLicense: .eula) + setURL(url, forURLType: .eula) } if let urlString = authenticationDocument.links?.first(where: { $0.rel == "license" })?.href, let url = URL(string: urlString) { - setURL(url, forLicense: .contentLicenses) + setURL(url, forURLType: .contentLicenses) } if let urlString = authenticationDocument.links?.first(where: { $0.rel == "copyright" })?.href, let url = URL(string: urlString) { - setURL(url, forLicense: .acknowledgements) + setURL(url, forURLType: .acknowledgements) } if let url = urlUnsubscribeEmail { - setURL(url, forLicense: .unsubscribeEmail) + setURL(url, forURLType: .unsubscribeEmail) } } - func setURL(_ URL: URL, forLicense urlType: URLType) -> Void { + func setURL(_ URL: URL, forURLType urlType: URLType) -> Void { switch urlType { case .acknowledgements: urlAcknowledgements = URL diff --git a/Simplified/Catalog/NYPLCatalogGroupedFeed.m b/Simplified/Catalog/NYPLCatalogGroupedFeed.m index 9089d4b56..8142f2a8f 100644 --- a/Simplified/Catalog/NYPLCatalogGroupedFeed.m +++ b/Simplified/Catalog/NYPLCatalogGroupedFeed.m @@ -58,27 +58,27 @@ - (instancetype)initWithOPDSFeed:(NYPLOPDSFeed *)feed } else if ([link.rel isEqualToString:NYPLOPDSEULALink]) { NSURL *href = link.href; - [currentAccount.details setURL:href forLicense:URLTypeEula]; + [currentAccount.details setURL:href forURLType:URLTypeEula]; continue; } else if ([link.rel isEqualToString:NYPLOPDSPrivacyPolicyLink]) { NSURL *href = link.href; - [currentAccount.details setURL:href forLicense:URLTypePrivacyPolicy]; + [currentAccount.details setURL:href forURLType:URLTypePrivacyPolicy]; continue; } else if ([link.rel isEqualToString:NYPLOPDSAcknowledgmentsLink]) { NSURL *href = link.href; - [currentAccount.details setURL:href forLicense:URLTypeAcknowledgements]; + [currentAccount.details setURL:href forURLType:URLTypeAcknowledgements]; continue; } else if ([link.rel isEqualToString:NYPLOPDSContentLicenseLink]) { NSURL *href = link.href; - [currentAccount.details setURL:href forLicense:URLTypeContentLicenses]; + [currentAccount.details setURL:href forURLType:URLTypeContentLicenses]; continue; } else if ([link.rel isEqualToString:NYPLOPDSRelationAnnotations]) { NSURL *href = link.href; - [currentAccount.details setURL:href forLicense:URLTypeAnnotations]; + [currentAccount.details setURL:href forURLType:URLTypeAnnotations]; continue; } } From 2fd0367132c2fe939ef79d663f70d1ff82c6fefb Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 19 Aug 2022 10:37:33 -0700 Subject: [PATCH 12/15] IOS-412 Refactor methods to get/set auth doc relation URLs --- Simplified/Accounts/Library/Account.swift | 96 ++++++++++------------- 1 file changed, 42 insertions(+), 54 deletions(-) diff --git a/Simplified/Accounts/Library/Account.swift b/Simplified/Accounts/Library/Account.swift index 1b33d6ceb..599491cb1 100644 --- a/Simplified/Accounts/Library/Account.swift +++ b/Simplified/Accounts/Library/Account.swift @@ -185,7 +185,9 @@ class OPDS2SamlIDP: NSObject, Codable { let supportsSimplyESync:Bool let supportsCardCreator:Bool let supportsReservations:Bool - let supportsUnsubscribeEmail:Bool + var supportsUnsubscribeEmail: Bool { + urlUnsubscribeEmail != nil + } let auths: [Authentication] let mainColor:String? @@ -286,9 +288,6 @@ class OPDS2SamlIDP: NSObject, Codable { } urlUnsubscribeEmail = URL.init(string: authenticationDocument.links?.first(where: { $0.rel == "http://librarysimplified.org/rel/email/unsubscribe/options" })?.href ?? "") - // TODO: For Testing, remove when in prod - urlUnsubscribeEmail = URL.init(string: "https://pub.email.nypl.org/manage-subscriptions") - supportsUnsubscribeEmail = urlUnsubscribeEmail != nil super.init() @@ -321,79 +320,50 @@ class OPDS2SamlIDP: NSObject, Codable { switch urlType { case .acknowledgements: urlAcknowledgements = URL - setAccountDictionaryKey("urlAcknowledgements", toValue: URL.absoluteString as AnyObject) case .contentLicenses: urlContentLicenses = URL - setAccountDictionaryKey("urlContentLicenses", toValue: URL.absoluteString as AnyObject) case .eula: urlEULA = URL - setAccountDictionaryKey("urlEULA", toValue: URL.absoluteString as AnyObject) case .privacyPolicy: urlPrivacyPolicy = URL - setAccountDictionaryKey("urlPrivacyPolicy", toValue: URL.absoluteString as AnyObject) case .annotations: urlAnnotations = URL - setAccountDictionaryKey("urlAnnotations", toValue: URL.absoluteString as AnyObject) case .unsubscribeEmail: urlUnsubscribeEmail = URL - setAccountDictionaryKey("urlUnsubscribeEmail", toValue: URL.absoluteString as AnyObject) } + + setAccountDictionaryKey(urlType.stringValue, toValue: URL.absoluteString as AnyObject) } func getLicenseURL(_ type: URLType) -> URL? { + let url: URL? switch type { case .acknowledgements: - if let url = urlAcknowledgements { - return url - } else { - guard let urlString = getAccountDictionaryKey("urlAcknowledgements") as? String else { return nil } - guard let result = URL(string: urlString) else { return nil } - return result - } + url = urlAcknowledgements case .contentLicenses: - if let url = urlContentLicenses { - return url - } else { - guard let urlString = getAccountDictionaryKey("urlContentLicenses") as? String else { return nil } - guard let result = URL(string: urlString) else { return nil } - return result - } + url = urlContentLicenses case .eula: - if let url = urlEULA { - return url - } else { - guard let urlString = getAccountDictionaryKey("urlEULA") as? String else { return nil } - guard let result = URL(string: urlString) else { return nil } - return result - } + url = urlEULA case .privacyPolicy: - if let url = urlPrivacyPolicy { - return url - } else { - guard let urlString = getAccountDictionaryKey("urlPrivacyPolicy") as? String else { return nil } - guard let result = URL(string: urlString) else { return nil } - return result - } + url = urlPrivacyPolicy case .annotations: - if let url = urlAnnotations { - return url - } else { - guard let urlString = getAccountDictionaryKey("urlAnnotations") as? String else { return nil } - guard let result = URL(string: urlString) else { return nil } - return result - } + url = urlAnnotations case .unsubscribeEmail: - if let url = urlUnsubscribeEmail { - return url - } else { - guard let urlString = getAccountDictionaryKey("urlUnsubscribeEmail") as? String else { return nil } - guard let result = URL(string: urlString) else { return nil } - return result - } + url = urlUnsubscribeEmail } + + if url != nil { + return url + } + + if let urlString = getAccountDictionaryKey(type.stringValue) as? String { + return URL(string: urlString) + } + + return nil } - fileprivate func setAccountDictionaryKey(_ key: String, toValue value: AnyObject) { + private func setAccountDictionaryKey(_ key: String, toValue value: AnyObject) { if var savedDict = defaults.value(forKey: self.uuid) as? [String: AnyObject] { savedDict[key] = value defaults.set(savedDict, forKey: self.uuid) @@ -402,7 +372,7 @@ class OPDS2SamlIDP: NSObject, Codable { } } - fileprivate func getAccountDictionaryKey(_ key: String) -> AnyObject? { + private func getAccountDictionaryKey(_ key: String) -> AnyObject? { let savedDict = defaults.value(forKey: self.uuid) as? [String: AnyObject] guard let result = savedDict?[key] else { return nil } return result @@ -529,6 +499,7 @@ extension AccountDetails { supportsSimplyESync=\(supportsSimplyESync) supportsCardCreator=\(supportsCardCreator) supportsReservations=\(supportsReservations) + supportsUnsubscribeEmail=\(supportsUnsubscribeEmail) """ } } @@ -553,6 +524,23 @@ extension Account { case privacyPolicy case annotations case unsubscribeEmail + + var stringValue: String { + switch self { + case .acknowledgements: + return "urlAcknowledgements" + case .contentLicenses: + return "urlContentLicenses" + case .eula: + return "urlEULA" + case .privacyPolicy: + return "urlPrivacyPolicy" + case .annotations: + return "urlAnnotations" + case .unsubscribeEmail: + return "urlUnsubscribeEmail" + } + } } // MARK: LoginKeyboard From cef50d42fc827723857b6408d55964716d1c4e44 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 19 Aug 2022 10:52:20 -0700 Subject: [PATCH 13/15] IOS-412 Bump SimplyE build number --- Simplified.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index cf10ec462..4d4c55e59 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5598,7 +5598,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5649,7 +5649,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -5699,7 +5699,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -5747,7 +5747,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -6017,7 +6017,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -6068,7 +6068,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 4; DEVELOPMENT_TEAM = 7262U6ST2R; ENABLE_BITCODE = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; From 2ed14c150005678e0c4dec0ecdc8426acef47933 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Fri, 19 Aug 2022 17:18:50 -0700 Subject: [PATCH 14/15] IOS-412 Unsubscribe from email opens outside of app --- .../NYPLSettingsAccountDetailViewController.m | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m index dad4b239f..ad47902b0 100644 --- a/Simplified/Settings/NYPLSettingsAccountDetailViewController.m +++ b/Simplified/Settings/NYPLSettingsAccountDetailViewController.m @@ -772,11 +772,8 @@ - (void)tableView:(__attribute__((unused)) UITableView *)tableView break; case CellKindUnsubscribeEmail: { [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; - RemoteHTMLViewController *vc = [[RemoteHTMLViewController alloc] - initWithURL:[self.selectedAccount.details getLicenseURL:URLTypeUnsubscribeEmail] - title:NSLocalizedString(@"Unsubscribe from Emails", nil) - failureMessage:NSLocalizedString(@"The page could not load due to a connection error.", nil)]; - [self.navigationController pushViewController:vc animated:YES]; + NSURL *url = [self.selectedAccount.details getLicenseURL:URLTypeUnsubscribeEmail]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; break; } } @@ -1119,7 +1116,7 @@ - (UITableViewCell *)tableView:(__attribute__((unused)) UITableView *)tableView return [self deletionStyleTableViewCell:NSLocalizedString(@"Delete Library Card", nil)]; } case CellKindUnsubscribeEmail: { - return [self deletionStyleTableViewCell:NSLocalizedString(@"Unsubscribe from Emails", nil)]; + return [self deletionStyleNoChevronTableViewCell:NSLocalizedString(@"Unsubscribe from Emails", nil)]; } } } @@ -1139,14 +1136,19 @@ - (UIImageView *)rightArrowImageView { return imageView; } -- (UITableViewCell *)deletionStyleTableViewCell:(NSString *)title { +- (UITableViewCell *)deletionStyleNoChevronTableViewCell:(NSString *)title { UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]; cell.textLabel.font = [UIFont customFontForTextStyle:UIFontTextStyleBody]; cell.textLabel.text = title; cell.textLabel.textColor = NYPLConfiguration.deleteActionColor; - + return cell; +} + +- (UITableViewCell *)deletionStyleTableViewCell:(NSString *)title { + UITableViewCell *cell = [self deletionStyleNoChevronTableViewCell:title]; + UIImageView *imageView = [self rightArrowImageView]; imageView.tintColor = NYPLConfiguration.deleteActionColor; cell.accessoryView = imageView; From 6b673ba6ff5c14a3290ec207c720e1038c65c1b2 Mon Sep 17 00:00:00 2001 From: Ettore Pasquini Date: Tue, 23 Aug 2022 09:12:52 -0700 Subject: [PATCH 15/15] OE-626 Bump build number for RC build --- Simplified.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Simplified.xcodeproj/project.pbxproj b/Simplified.xcodeproj/project.pbxproj index 4d4c55e59..26c845a65 100644 --- a/Simplified.xcodeproj/project.pbxproj +++ b/Simplified.xcodeproj/project.pbxproj @@ -5793,7 +5793,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch"; @@ -5841,7 +5841,7 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR; CODE_SIGN_ENTITLEMENTS = Simplified/SimplyE.entitlements; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 6; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = 7262U6ST2R; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Simplified/AppInfrastructure/Simplified-Prefix.pch";