Skip to content

Commit

Permalink
Skip authentication bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctdewaters committed Oct 9, 2019
1 parent c422f6c commit 4f1b3fb
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 20 deletions.
12 changes: 6 additions & 6 deletions Music Memories.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = AP48SCT3J2;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Notifications/Memory Reminder Notification/Info.plist";
Expand All @@ -1617,7 +1617,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = AP48SCT3J2;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Notifications/Memory Reminder Notification/Info.plist";
Expand Down Expand Up @@ -1768,7 +1768,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = AP48SCT3J2;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -1804,7 +1804,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = AP48SCT3J2;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -1834,7 +1834,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = AP48SCT3J2;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Notifications/Dynamic Memory Notification/Info.plist";
Expand All @@ -1861,7 +1861,7 @@
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_TEAM = AP48SCT3J2;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = "$(SRCROOT)/iOS/Notifications/Dynamic Memory Notification/Info.plist";
Expand Down
Binary file not shown.
17 changes: 15 additions & 2 deletions iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
//MARK: - UIApplicationDelegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

UserDefaults.standard.set(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")

//Set the current user notification center delegate to the app delegate.
Expand Down Expand Up @@ -292,7 +292,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
self.window?.rootViewController = onboardingStoryboard.instantiateInitialViewController()
return
}
if !MKAuth.isAuthenticated {

if !MKAuth.isAuthenticated && didSkipAuth == false {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.window?.rootViewController?.present(onboardingStoryboard.instantiateInitialViewController()!, animated: true, completion: nil)
}
Expand All @@ -311,6 +312,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD

case .revoked, .notFound :
//User is not signed in, sign out locally, delete the account associated memories, and show the onboarding process with the login view controller.

if didSkipAuth { return }
MKAuth.signOut()

//Retreive all memories in a private queue MOC.
Expand Down Expand Up @@ -473,3 +476,13 @@ class ApplicationOpenSettings {

init() {}
}


var didSkipAuth: Bool {
set {
UserDefaults.standard.set(newValue, forKey: "didSkipAuthentication")
}
get {
return UserDefaults.standard.bool(forKey: "didSkipAuthentication")
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MemoryCell: UICollectionViewCell {
func setup(withMemory memory: MKMemory) {
//Set the memory of this cell, along with the memory's data.
self.memory = memory
self.songCountLabel.text = "\(memory.items?.count ?? 0) Tracks"
self.songCountLabel.text = "\(memory.items?.count ?? 0) Songs"
self.titleLabel.text = memory.title ?? ""

//Dynamic memory setup.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -74,8 +74,8 @@
<color key="textColor" systemColor="secondaryLabelColor" red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto-Memory" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WuS-kS-Lr0">
<rect key="frame" x="226.5" y="413" width="86.5" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Dynamic Memory" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WuS-kS-Lr0">
<rect key="frame" x="203" y="413" width="110" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="M2L-9m-x7E"/>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="116" id="r42-Yv-nYM"/>
Expand All @@ -85,7 +85,7 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo500White" translatesAutoresizingMaskIntoConstraints="NO" id="fbw-Rc-GjF">
<rect key="frame" x="197.5" y="413" width="25" height="17"/>
<rect key="frame" x="174" y="413" width="25" height="17"/>
<color key="tintColor" name="themeColor"/>
<constraints>
<constraint firstAttribute="width" constant="25" id="Efi-fx-ojS"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ class MemoriesViewController: UIViewController, UICollectionViewDelegateFlowLayo

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

UIWindow.key?.rootViewController = self.tabBarController


//Reload.
self.safeReload()
self.previousWidth = self.view.frame.width
Expand Down
1 change: 0 additions & 1 deletion iOS/Memories/Memory/MemoryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class MemoryViewController: MediaCollectionViewController {
@IBOutlet weak var songCountLabel: UILabel!
@IBOutlet weak var showImagesButton: UIButton!


//MARK: - Properties
///The memory to display.
weak var memory: MKMemory?
Expand Down
3 changes: 3 additions & 0 deletions iOS/Onboarding/OnboardingAuthenticationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ class OnboardingAuthenticationViewController: UIViewController {
}

@IBAction func next(_ sender: Any) {
didSkipAuth = true

print(didSkipAuth)
if UIWindow.key?.rootViewController is OnboardingVideoBackgroundViewController {
if let button = sender as? UIButton {
self.removeHighlight(button: button)
Expand Down
4 changes: 2 additions & 2 deletions iOS/UI/Storyboards/Onboarding.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
</constraints>
<string key="text">You can sign in to Music Memories using your Apple ID. This will enable:

•Cloud Backups
•Device Syncing: Memories will appear across all of your signed in devices.
Cloud Backups
Device Syncing: Memories will appear across all of your signed in devices.

By skipping this step, memories created on this device will only be available here.</string>
<fontDescription key="fontDescription" name="SFProRounded-Medium" family="SF Pro Rounded" pointSize="18"/>
Expand Down

0 comments on commit 4f1b3fb

Please sign in to comment.