diff --git a/Technotes/ReleaseNotes-iOS.markdown b/Technotes/ReleaseNotes-iOS.markdown index 000fb367d..9c52b0fe2 100644 --- a/Technotes/ReleaseNotes-iOS.markdown +++ b/Technotes/ReleaseNotes-iOS.markdown @@ -1,5 +1,9 @@ # iOS Release Notes +### 6.1.1 TestFlight build 6114 - 5 Feb 2023 + +Remove Twitter integration. Include alert that Twitter integration was removed. + ### 6.1.1 TestFlight build 6113 - 22 Jan 2023 Fix a crashing bug when fetching data for the widget diff --git a/iOS/AppDefaults.swift b/iOS/AppDefaults.swift index 10ed0af43..aaac06006 100644 --- a/iOS/AppDefaults.swift +++ b/iOS/AppDefaults.swift @@ -58,6 +58,7 @@ final class AppDefaults { static let addFolderAccountID = "addFolderAccountID" static let useSystemBrowser = "useSystemBrowser" static let currentThemeName = "currentThemeName" + static let twitterDeprecationAlertShown = "twitterDeprecationAlertShown" } let isDeveloperBuild: Bool = { @@ -223,6 +224,15 @@ final class AppDefaults { } } + var twitterDeprecationAlertShown: Bool { + get { + return AppDefaults.bool(for: Key.twitterDeprecationAlertShown) + } + set { + AppDefaults.setBool(for: Key.twitterDeprecationAlertShown, newValue) + } + } + static func registerDefaults() { let defaults: [String : Any] = [Key.userInterfaceColorPalette: UserInterfaceColorPalette.automatic.rawValue, Key.timelineGroupByFeed: false, diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index cfadf175f..0409d0e8b 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -94,6 +94,16 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner, Ma super.viewWillAppear(animated) } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + if (isBeingPresented || isMovingToParent) { + // Only show the Twitter alert the first time + // the view is presented. + presentTwitterDeprecationAlertIfRequired() + } + } + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) if traitCollection.preferredContentSizeCategory != previousTraitCollection?.preferredContentSizeCategory { @@ -649,7 +659,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner, Ma self.addNewItemButton.menu = contextMenu } - + func focus() { becomeFirstResponder() } @@ -662,6 +672,29 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner, Ma } } + private func presentTwitterDeprecationAlertIfRequired() { + if AppDefaults.shared.twitterDeprecationAlertShown { return } + + let expiryDate = Date(timeIntervalSince1970: 1691539200) // August 9th 2023, 00:00 UTC + let currentDate = Date() + if currentDate > expiryDate { + return // If after August 9th, don't show + } + + if AccountManager.shared.anyLocalOriCloudAccountHasAtLeastOneTwitterFeed() { + showTwitterDeprecationAlert() + } + AppDefaults.shared.twitterDeprecationAlertShown = true + } + + private func showTwitterDeprecationAlert() { + let alert = UIAlertController(title: NSLocalizedString("Twitter Integration Removed", comment: "Twitter Integration Removed"), + message: NSLocalizedString("On February 1, 2023, Twitter announced the end of free access to the Twitter API, effective February 9.\n\nSince Twitter does not provide RSS feeds, we’ve had to use the Twitter API. Without free access to that API, we can’t read feeds from Twitter.\n\nWe’ve left your Twitter feeds intact. If you have any starred items from those feeds, they will remain as long as you don’t delete those feeds.\n\nYou can still read whatever you have already downloaded. However, those feeds will no longer update.", comment: "Twitter deprecation message"), + preferredStyle: .alert) + + alert.addAction(UIAlertAction(title: "OK", style: .cancel)) + present(alert, animated: true) + } } // MARK: UIContextMenuInteractionDelegate diff --git a/xcconfig/common/NetNewsWire_ios_target_common.xcconfig b/xcconfig/common/NetNewsWire_ios_target_common.xcconfig index 35aaea4ec..6cc3d75cc 100644 --- a/xcconfig/common/NetNewsWire_ios_target_common.xcconfig +++ b/xcconfig/common/NetNewsWire_ios_target_common.xcconfig @@ -1,7 +1,7 @@ // High Level Settings common to both the iOS application and any extensions we bundle with it MARKETING_VERSION = 6.1.1 -CURRENT_PROJECT_VERSION = 6113 +CURRENT_PROJECT_VERSION = 6114 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon