diff --git a/.configure b/.configure index b9617d8d5144..a059eb3e408e 100644 --- a/.configure +++ b/.configure @@ -1,7 +1,7 @@ { "project_name": "WordPress-iOS", "branch": "trunk", - "pinned_hash": "96b8f38f614556658c0cf5eb86a61027d48fd1de", + "pinned_hash": "671341de5698d1ef34d0dd6f36bf526d578b22c7", "files_to_copy": [ { "file": "iOS/WPiOS/project.env", @@ -32,9 +32,12 @@ "file": "iOS/JPiOS/Jetpack-Secrets.swift", "destination": "~/.configure/wordpress-ios/secrets/Jetpack-Secrets.swift", "encrypt": true + }, + { + "file": "iOS/Reader/Reader-Secrets.swift", + "destination": "~/.configure/wordpress-ios/secrets/Reader-Secrets.swift", + "encrypt": true } ], - "file_dependencies": [ - - ] + "file_dependencies": [] } \ No newline at end of file diff --git a/.configure-files/Jetpack-Secrets.swift.enc b/.configure-files/Jetpack-Secrets.swift.enc index b3ab119ff553..ea3cc37302b2 100644 Binary files a/.configure-files/Jetpack-Secrets.swift.enc and b/.configure-files/Jetpack-Secrets.swift.enc differ diff --git a/.configure-files/Reader-Secrets.swift.enc b/.configure-files/Reader-Secrets.swift.enc new file mode 100644 index 000000000000..9001908664a9 Binary files /dev/null and b/.configure-files/Reader-Secrets.swift.enc differ diff --git a/.configure-files/Secrets-Alpha.swift.enc b/.configure-files/Secrets-Alpha.swift.enc index c7bfba6fedea..6d064130c099 100644 Binary files a/.configure-files/Secrets-Alpha.swift.enc and b/.configure-files/Secrets-Alpha.swift.enc differ diff --git a/.configure-files/Secrets-Internal.swift.enc b/.configure-files/Secrets-Internal.swift.enc index 4fc179765ac9..034b369c157c 100644 Binary files a/.configure-files/Secrets-Internal.swift.enc and b/.configure-files/Secrets-Internal.swift.enc differ diff --git a/.configure-files/Secrets.swift.enc b/.configure-files/Secrets.swift.enc index 1e38571839cc..500132fd96da 100644 Binary files a/.configure-files/Secrets.swift.enc and b/.configure-files/Secrets.swift.enc differ diff --git a/Scripts/BuildPhases/GenerateCredentials.sh b/Scripts/BuildPhases/GenerateCredentials.sh index 5c9abe9771d3..7497dc8e6ce8 100755 --- a/Scripts/BuildPhases/GenerateCredentials.sh +++ b/Scripts/BuildPhases/GenerateCredentials.sh @@ -52,10 +52,7 @@ ensure_is_in_input_files_list $WORDPRESS_SECRETS_FILE JETPACK_SECRETS_FILE="${SECRETS_ROOT}/Jetpack-Secrets.swift" ensure_is_in_input_files_list $JETPACK_SECRETS_FILE -# TODO: We'll need a dedicated one for Reader... -# READER_SECRETS_FILE="${SECRETS_ROOT}/Reader-Secrets.swift" -# ...using WordPress-Secrets.swift for now. -READER_SECRETS_FILE="${SECRETS_ROOT}/WordPress-Secrets.swift" +READER_SECRETS_FILE="${SECRETS_ROOT}/Reader-Secrets.swift" ensure_is_in_input_files_list $READER_SECRETS_FILE LOCAL_SECRETS_FILE="${SRCROOT}/Credentials/Secrets.swift" diff --git a/Scripts/BuildPhases/GenerateCredentials.xcfilelist b/Scripts/BuildPhases/GenerateCredentials.xcfilelist index 7c04a0f6df97..c52def6be2d1 100644 --- a/Scripts/BuildPhases/GenerateCredentials.xcfilelist +++ b/Scripts/BuildPhases/GenerateCredentials.xcfilelist @@ -4,6 +4,7 @@ ${HOME}/.configure/wordpress-ios/secrets/WordPress-Secrets.swift ${HOME}/.configure/wordpress-ios/secrets/WordPress-Secrets-Internal.swift ${HOME}/.configure/wordpress-ios/secrets/WordPress-Secrets-Alpha.swift ${HOME}/.configure/wordpress-ios/secrets/Jetpack-Secrets.swift +${HOME}/.configure/wordpress-ios/secrets/Reader-Secrets.swift # Local Secrets file that external contributors can use to specify their own # ClientID and Secrets. This file is created by the Rakefile when external diff --git a/Sources/Reader/main.swift b/Sources/Reader/main.swift index b10e026c7400..d95803bb8a39 100644 --- a/Sources/Reader/main.swift +++ b/Sources/Reader/main.swift @@ -7,9 +7,7 @@ import WordPress // This is because `BuildSettings` are not propagated through the app via chain injection but accessed via a `static` `current` property for convenience. // Also for convenience, we assume the secrets not to be nil at runtime, to avoid unwrapping values that we know must be there. // Therefore, we need to make the secrets available to `BuildSettings` before the app starts. -// FIXME: Sort ot Reader having its own ApiCredentials (soon to be BuildSecrets) instance -//BuildSettings.configure(secrets: ApiCredentials.toSecrets()) -BuildSettings.configure(secrets: BuildSecrets.dummy) +BuildSettings.configure(secrets: ApiCredentials.toSecrets()) UIApplicationMain( CommandLine.argc, diff --git a/WordPress/Classes/Apps/Reader/ReaderTabViewController.swift b/WordPress/Classes/Apps/Reader/ReaderTabViewController.swift index c935b45c855e..5527c9529dbe 100644 --- a/WordPress/Classes/Apps/Reader/ReaderTabViewController.swift +++ b/WordPress/Classes/Apps/Reader/ReaderTabViewController.swift @@ -108,7 +108,7 @@ final class ReaderTabViewController: UITabBarController, UITabBarControllerDeleg } private func makeNotificationsViewController() -> UIViewController { - let notificationsVC = UIStoryboard(name: "Notifications", bundle: nil) + let notificationsVC = UIStoryboard(name: "Notifications", bundle: Bundle(for: Self.self)) .instantiateInitialViewController() as! NotificationsViewController notificationsVC.tabBarItem = UITabBarItem( title: Strings.notifications, diff --git a/WordPress/Classes/Utility/ViewLoading/NibLoadable.swift b/WordPress/Classes/Utility/ViewLoading/NibLoadable.swift index 057d00e9a72f..0fd29a8576ca 100644 --- a/WordPress/Classes/Utility/ViewLoading/NibLoadable.swift +++ b/WordPress/Classes/Utility/ViewLoading/NibLoadable.swift @@ -1,7 +1,7 @@ import UIKit /// A protocol for views that can be loaded from nibs. -public protocol NibLoadable { +public protocol NibLoadable: AnyObject { /// Default nib name. static var defaultNibName: String { get } @@ -20,7 +20,7 @@ public extension NibLoadable { } static var defaultBundle: Bundle { - return Bundle.main + return Bundle(for: Self.self) } static var defaultNib: UINib { diff --git a/config/Reader.alpha.xcconfig b/config/Reader.alpha.xcconfig index 23b69df1c25e..a2d1395dac09 100644 --- a/config/Reader.alpha.xcconfig +++ b/config/Reader.alpha.xcconfig @@ -3,4 +3,4 @@ WP_PUSH_NOTIFICATION_APP_ID = TBD WP_BUILD_CONFIGURATION = alpha -WP_APP_URL_SCHEME = TBD +WP_APP_URL_SCHEME = wpreader diff --git a/config/Reader.debug.xcconfig b/config/Reader.debug.xcconfig index 77ea83b63dc7..b42986f466aa 100644 --- a/config/Reader.debug.xcconfig +++ b/config/Reader.debug.xcconfig @@ -2,7 +2,7 @@ #include "Version.public.xcconfig" WP_PUSH_NOTIFICATION_APP_ID = TBD -WP_BUILD_CONFIGURATION = alpha -WP_APP_URL_SCHEME = TBD +WP_BUILD_CONFIGURATION = debug +WP_APP_URL_SCHEME = wpreader PROVISIONING_PROFILE_SPECIFIER = Reader Development diff --git a/config/Reader.release.xcconfig b/config/Reader.release.xcconfig index 338563fb43a0..745b5a278e50 100644 --- a/config/Reader.release.xcconfig +++ b/config/Reader.release.xcconfig @@ -2,7 +2,7 @@ #include "Version.public.xcconfig" WP_PUSH_NOTIFICATION_APP_ID = TBD -WP_BUILD_CONFIGURATION = alpha -WP_APP_URL_SCHEME = TBD +WP_BUILD_CONFIGURATION = release +WP_APP_URL_SCHEME = wpreader PROVISIONING_PROFILE_SPECIFIER = match AppStore ${PRODUCT_BUNDLE_IDENTIFIER}