Skip to content

Commit

Permalink
Version 1.1.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctdewaters committed Jun 8, 2018
1 parent 8a6a2bc commit d222f69
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 91 deletions.
6 changes: 3 additions & 3 deletions MemoriesKit/MKAuth.swift
Expand Up @@ -72,7 +72,7 @@ public class MKAuth {
}

///If true, the music user token has been attempted to be retrieved once.
public static var musicUserTokenRetrievalAttempted = false
public static var musicUserTokenRetrievalAttempts = 0

//MARK: - Notification names
public static let developerTokenWasRetrievedNotification = Notification.Name("developerTokenWasRetreivedNotification")
Expand Down Expand Up @@ -113,7 +113,7 @@ public class MKAuth {

///Retrieves the music user token for interaction with a user's library in Apple Music.
public class func retrieveMusicUserToken(withCompletion completion: ((String?) -> Void)? = nil) {
MKAuth.musicUserTokenRetrievalAttempted = true
MKAuth.musicUserTokenRetrievalAttempts += 1

if SKCloudServiceController.authorizationStatus() == .authorized {
if let musicUserToken = self.musicUserToken {
Expand Down Expand Up @@ -159,7 +159,7 @@ public class MKAuth {
//Check if the user authorized.
if authorized {
//Authorized, attempt to retrieve the music user token if no attempt has been made.
if !MKAuth.musicUserTokenRetrievalAttempted {
if MKAuth.musicUserTokenRetrievalAttempts <= 2 {
MKAuth.retrieveMusicUserToken(withCompletion: completion)
}
else {
Expand Down
8 changes: 0 additions & 8 deletions Music Memories.xcodeproj/project.pbxproj
Expand Up @@ -269,10 +269,6 @@
B8960B4420C9C49F0064D48E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
B8960B4720C9C4AA0064D48E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
B8960B4A20C9C4B90064D48E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Onboarding.storyboard; sourceTree = "<group>"; };
B8960B4C20C9C4CB0064D48E /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
B8960B4D20C9C4CB0064D48E /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Main.strings; sourceTree = "<group>"; };
B8960B4E20C9C4CC0064D48E /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Onboarding.strings; sourceTree = "<group>"; };
B8960B4F20C9C4CC0064D48E /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Interface.strings; sourceTree = "<group>"; };
B89D2A4D1F92DC0000C0F088 /* MemoriesKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MemoriesKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B89D2A4F1F92DC0100C0F088 /* MemoriesKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MemoriesKit.h; sourceTree = "<group>"; };
B89D2A501F92DC0100C0F088 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1251,7 +1247,6 @@
isa = PBXVariantGroup;
children = (
B8960B4420C9C49F0064D48E /* Base */,
B8960B4C20C9C4CB0064D48E /* ar */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
Expand All @@ -1260,7 +1255,6 @@
isa = PBXVariantGroup;
children = (
B8960B4720C9C4AA0064D48E /* Base */,
B8960B4D20C9C4CB0064D48E /* ar */,
);
name = Main.storyboard;
sourceTree = "<group>";
Expand All @@ -1269,7 +1263,6 @@
isa = PBXVariantGroup;
children = (
B8960B4A20C9C4B90064D48E /* Base */,
B8960B4E20C9C4CC0064D48E /* ar */,
);
name = Onboarding.storyboard;
sourceTree = "<group>";
Expand All @@ -1278,7 +1271,6 @@
isa = PBXVariantGroup;
children = (
B8EF31EB202FDDC900C96BAB /* Base */,
B8960B4F20C9C4CC0064D48E /* ar */,
);
name = Interface.storyboard;
sourceTree = "<group>";
Expand Down
Expand Up @@ -29,12 +29,12 @@
<key>orderHint</key>
<integer>18</integer>
</dict>
<key>Music Memories-watchOS.xcscheme</key>
<key>Music Memories-watchOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Music Memories.xcscheme</key>
<key>Music Memories.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
Expand Down
2 changes: 1 addition & 1 deletion Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions iOS/AppDelegate.swift
Expand Up @@ -74,6 +74,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WCSessionDelegate {
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

//Check if onboarding is complete, if so, check if the tokens are valid.
if Settings.shared.onboardingComplete {
DispatchQueue.global().async {
//Check tokens.
Expand All @@ -91,7 +92,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WCSessionDelegate {
//Reload tokens.
MKAuth.resetTokens()

if !MKAuth.musicUserTokenRetrievalAttempted {
if MKAuth.musicUserTokenRetrievalAttempts < 1 {
MKAuth.retrieveMusicUserToken()
}
}
Expand Down Expand Up @@ -177,9 +178,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WCSessionDelegate {
}
}
}
else {
print("SESSION ACTIVATION ISSUE")
}
}

func sessionDidBecomeInactive(_ session: WCSession) {
Expand All @@ -189,9 +187,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WCSessionDelegate {
}

func session(_ session: WCSession, didReceiveMessage message: [String : Any]) {

print("MESSAGE RECIEVED: \n\n\n\n \(message)")


if let messageCode = message["MMMessageCode"] as? Int {
if messageCode == ApplicationOpenSettings.createCode {
self.handleCreateMemoryResponse()
Expand Down
2 changes: 1 addition & 1 deletion iOS/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.1.2</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
13 changes: 7 additions & 6 deletions iOS/Memory Creation/Complete View/MemoryCreationCompleteView.xib
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13770" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13770"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14252.5"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -23,15 +24,15 @@
<constraint firstAttribute="height" constant="37" id="rDi-7O-kG5"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
<state key="normal" title="Close">
<state key="normal" title="Done">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="close:" destination="iN0-l3-epB" eventType="touchUpInside" id="coL-eu-7G5"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="08t-yE-kya">
<rect key="frame" x="137" y="248.5" width="100" height="100"/>
<rect key="frame" x="137.5" y="248.5" width="100" height="100"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="O6V-Ue-vaU"/>
<constraint firstAttribute="height" constant="100" id="s97-ih-Jn0"/>
Expand All @@ -40,9 +41,9 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sync this memory with your Apple Music Library: " textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="APH-Co-McB">
<rect key="frame" x="16" y="508" width="234" height="47"/>
<constraints>
<constraint firstAttribute="height" constant="47" id="A9c-Rz-JWk"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="47" id="A9c-Rz-JWk"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
Expand Down
15 changes: 8 additions & 7 deletions iOS/Memory Creation/Date View/MemoryCreationDateView.xib
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14087.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14075.4"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14252.5"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -35,14 +36,14 @@
<rect key="frame" x="95" y="141" width="185" height="40"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder=" Choose Start Date" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Fjo-Sc-ALD">
<rect key="frame" x="95" y="50" width="185" height="40"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XOJ-qr-VVQ">
Expand All @@ -61,7 +62,7 @@
</connections>
</button>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="V1j-jL-rIW">
<rect key="frame" x="42" y="600" width="80" height="37"/>
<rect key="frame" x="42.5" y="600" width="80" height="37"/>
<color key="backgroundColor" red="0.18176404900000001" green="0.1886334197" blue="0.1843332563" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="37" id="3GG-eE-48S"/>
Expand Down Expand Up @@ -90,12 +91,12 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="To" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yqu-9m-oOM">
<rect key="frame" x="132" y="100" width="110" height="31"/>
<rect key="frame" x="132.5" y="100" width="110" height="31"/>
<constraints>
<constraint firstAttribute="height" constant="31" id="WND-ne-i6D"/>
<constraint firstAttribute="width" constant="110" id="z8Q-KX-z4O"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
Expand Down
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14252.5"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -23,7 +24,7 @@
<constraints>
<constraint firstAttribute="height" constant="21" id="ptY-TO-bud"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="19"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
Expand All @@ -32,7 +33,7 @@
<constraints>
<constraint firstAttribute="height" constant="12.5" id="VJ5-ZX-o2M"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
Expand Down

0 comments on commit d222f69

Please sign in to comment.