diff --git a/.travis.yml b/.travis.yml index c7ee62db0..4f2975068 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ reference: http://www.objc.io/issue-6/travis-ci.html language: objective-c -osx_image: xcode6.4 +osx_image: xcode7 install: - bundle install diff --git a/Lock.podspec b/Lock.podspec index ad5653c15..e52bae796 100644 --- a/Lock.podspec +++ b/Lock.podspec @@ -89,6 +89,16 @@ Auth0 is a SaaS that helps you with Authentication and Authorization. You can us sms.resource_bundles = { 'Auth0.SMS' => ['Pod/Assets/SMS/*.plist', 'Pod/Assets/SMS/Images/*.png'] } end + s.subspec 'Email' do |email| + email.platform = :ios + email.public_header_files = 'Pod/Classes/Email/*.h' + email.private_header_files = 'Pod/Classes/Email/Private/*.h' + email.source_files = ['Pod/Classes/Email/*.{h,m}', 'Pod/Classes/Email/Private/*.{h,m}'] + email.resources = 'Pod/Assets/Email/*.xib' + email.dependency 'Lock/UI' + email.resource_bundles = { 'Auth0.Email' => ['Pod/Assets/Email/*.plist', 'Pod/Assets/Email/Images/*.png'] } + end + s.subspec '1Password' do |onepassword| onepassword.platform = :ios onepassword.public_header_files = 'Pod/Classes/1Password/*.h' diff --git a/Lock/Lock.xcodeproj/project.pbxproj b/Lock/Lock.xcodeproj/project.pbxproj index 4f35ee3d7..dd6b7517a 100644 --- a/Lock/Lock.xcodeproj/project.pbxproj +++ b/Lock/Lock.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 1963201521DC48EB2CE099C5 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EBE03102F38F6B4C779E3AA7 /* libPods-Tests.a */; }; + 423EE20195902EA7B6FEE2A7 /* libPods-Lock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E064118EC7AD3EEDE6297D57 /* libPods-Lock.a */; }; 5F0AA5BF1A78308100073120 /* A0APIClientSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F0AA5BE1A78308100073120 /* A0APIClientSpec.m */; }; 5F0ADBBC19E5FCB800EA7EAA /* A0SimpleConnectionDomainMatcherSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F0ADBBB19E5FCB800EA7EAA /* A0SimpleConnectionDomainMatcherSpec.m */; }; 5F12365C19675EA9006CE0D2 /* A0ApplicationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F12365B19675EA9006CE0D2 /* A0ApplicationSpec.m */; }; @@ -64,7 +64,7 @@ 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; - F59547DB5922E7296831F065 /* libPods-Lock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A0DF3DB1CF1B60C37EA055A /* libPods-Lock.a */; }; + D7A6FA1B79E21A9677691871 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9556E627A6C970326AA48DD /* libPods-Tests.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -78,9 +78,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 3C6006F47E64770EB84285B3 /* Pods-Lock.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Lock.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Lock/Pods-Lock.debug.xcconfig"; sourceTree = ""; }; - 3EA2B89CABCA670E8559CCE5 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; - 4FE86D747F16255659237957 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; + 572EFC8AFE63EBB3FDFFF57D /* Pods-Lock.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Lock.release.xcconfig"; path = "Pods/Target Support Files/Pods-Lock/Pods-Lock.release.xcconfig"; sourceTree = ""; }; 5F0935471A1AB4A600144E67 /* CHANGELOG.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = ""; }; 5F0AA5BE1A78308100073120 /* A0APIClientSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = A0APIClientSpec.m; sourceTree = ""; }; 5F0ADBBB19E5FCB800EA7EAA /* A0SimpleConnectionDomainMatcherSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = A0SimpleConnectionDomainMatcherSpec.m; sourceTree = ""; }; @@ -158,10 +156,12 @@ 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 77F27E12879146B986D43383 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 7A0DF3DB1CF1B60C37EA055A /* libPods-Lock.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Lock.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 785CD5636CC4F0219AF83208 /* Pods-Lock.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Lock.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Lock/Pods-Lock.debug.xcconfig"; sourceTree = ""; }; + 936C8D67A8F69B5F417E3BDC /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = ""; }; + 98764BA81EB282D5246EB984 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig"; sourceTree = ""; }; BD9DE0F8BCE04F059EE4B037 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - EBE03102F38F6B4C779E3AA7 /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - F15FC091EBF7DE612A84F1B9 /* Pods-Lock.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Lock.release.xcconfig"; path = "Pods/Target Support Files/Pods-Lock/Pods-Lock.release.xcconfig"; sourceTree = ""; }; + E064118EC7AD3EEDE6297D57 /* libPods-Lock.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Lock.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E9556E627A6C970326AA48DD /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -172,7 +172,7 @@ 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, - F59547DB5922E7296831F065 /* libPods-Lock.a in Frameworks */, + 423EE20195902EA7B6FEE2A7 /* libPods-Lock.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -184,13 +184,24 @@ 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, - 1963201521DC48EB2CE099C5 /* libPods-Tests.a in Frameworks */, + D7A6FA1B79E21A9677691871 /* libPods-Tests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 520E7E22D5D3081ABC792C8D /* Pods */ = { + isa = PBXGroup; + children = ( + 785CD5636CC4F0219AF83208 /* Pods-Lock.debug.xcconfig */, + 572EFC8AFE63EBB3FDFFF57D /* Pods-Lock.release.xcconfig */, + 936C8D67A8F69B5F417E3BDC /* Pods-Tests.debug.xcconfig */, + 98764BA81EB282D5246EB984 /* Pods-Tests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; 5FC7EECD1A7957BE00C83B09 /* HttpResponses */ = { isa = PBXGroup; children = ( @@ -232,7 +243,7 @@ 6003F5B5195388D20070C39A /* Tests */, 6003F58C195388D20070C39A /* Frameworks */, 6003F58B195388D20070C39A /* Products */, - 7B3604C1D518EAC6C4063835 /* Pods */, + 520E7E22D5D3081ABC792C8D /* Pods */, ); sourceTree = ""; }; @@ -253,8 +264,8 @@ 6003F58F195388D20070C39A /* CoreGraphics.framework */, 6003F591195388D20070C39A /* UIKit.framework */, 6003F5AF195388D20070C39A /* XCTest.framework */, - 7A0DF3DB1CF1B60C37EA055A /* libPods-Lock.a */, - EBE03102F38F6B4C779E3AA7 /* libPods-Tests.a */, + E064118EC7AD3EEDE6297D57 /* libPods-Lock.a */, + E9556E627A6C970326AA48DD /* libPods-Tests.a */, ); name = Frameworks; sourceTree = ""; @@ -350,17 +361,6 @@ name = "Podspec Metadata"; sourceTree = ""; }; - 7B3604C1D518EAC6C4063835 /* Pods */ = { - isa = PBXGroup; - children = ( - 3C6006F47E64770EB84285B3 /* Pods-Lock.debug.xcconfig */, - F15FC091EBF7DE612A84F1B9 /* Pods-Lock.release.xcconfig */, - 4FE86D747F16255659237957 /* Pods-Tests.debug.xcconfig */, - 3EA2B89CABCA670E8559CCE5 /* Pods-Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -368,12 +368,12 @@ isa = PBXNativeTarget; buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "Lock" */; buildPhases = ( - 889853524F0724937B583D98 /* Check Pods Manifest.lock */, + 1EADCA37ECABABC8B829668C /* Check Pods Manifest.lock */, 6003F586195388D20070C39A /* Sources */, 6003F587195388D20070C39A /* Frameworks */, 6003F588195388D20070C39A /* Resources */, 5F3A9C531A0D14D400154DF2 /* Fabric */, - 5D12E253386738CBD5594591 /* Copy Pods Resources */, + CD65E3E69F22398DF0075556 /* Copy Pods Resources */, ); buildRules = ( ); @@ -388,11 +388,11 @@ isa = PBXNativeTarget; buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "Tests" */; buildPhases = ( - 9D1C7C43B0B16DFCE3DEB891 /* Check Pods Manifest.lock */, + 5C5F4498FABB452B05D4A5AE /* Check Pods Manifest.lock */, 6003F5AA195388D20070C39A /* Sources */, 6003F5AB195388D20070C39A /* Frameworks */, 6003F5AC195388D20070C39A /* Resources */, - 6BF3047585FCD1CA79716611 /* Copy Pods Resources */, + 25E124A9EFA46C40715EED08 /* Copy Pods Resources */, ); buildRules = ( ); @@ -479,78 +479,78 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 5D12E253386738CBD5594591 /* Copy Pods Resources */ = { + 1EADCA37ECABABC8B829668C /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Lock/Pods-Lock-resources.sh\"\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 5F3A9C531A0D14D400154DF2 /* Fabric */ = { + 25E124A9EFA46C40715EED08 /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = Fabric; + name = "Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [ ${CONFIGURATION} != \"Debug\" ]; then\n echo \"Running Fabric scripts\"\n source $SRCROOT/.fabric_key\n \"${PODS_ROOT}/Fabric/Fabric.framework/run\" $FABRIC_API_KEY $FABRIC_BUILD_SECRET\nelse\n echo \"Skipped Fabric scripts\"\nfi"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; + showEnvVarsInLog = 0; }; - 6BF3047585FCD1CA79716611 /* Copy Pods Resources */ = { + 5C5F4498FABB452B05D4A5AE /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh\"\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - 889853524F0724937B583D98 /* Check Pods Manifest.lock */ = { + 5F3A9C531A0D14D400154DF2 /* Fabric */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = Fabric; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; + shellScript = "if [ ${CONFIGURATION} != \"Debug\" ]; then\n echo \"Running Fabric scripts\"\n source $SRCROOT/.fabric_key\n \"${PODS_ROOT}/Fabric/Fabric.framework/run\" $FABRIC_API_KEY $FABRIC_BUILD_SECRET\nelse\n echo \"Skipped Fabric scripts\"\nfi"; }; - 9D1C7C43B0B16DFCE3DEB891 /* Check Pods Manifest.lock */ = { + CD65E3E69F22398DF0075556 /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Lock/Pods-Lock-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -682,7 +682,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -715,7 +715,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -724,7 +724,7 @@ }; 6003F5C0195388D20070C39A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3C6006F47E64770EB84285B3 /* Pods-Lock.debug.xcconfig */; + baseConfigurationReference = 785CD5636CC4F0219AF83208 /* Pods-Lock.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -742,7 +742,7 @@ GCC_PREFIX_HEADER = "Lock/Lock-Prefix.pch"; GOOGLE_PLUS_CLIENT_ID = "856630117504-cman9rbv3t5diu2ksgkn4n3m4p0b84ti.apps.googleusercontent.com"; INFOPLIST_FILE = "Lock/Lock-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; PRODUCT_NAME = Lock; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; @@ -751,7 +751,7 @@ }; 6003F5C1195388D20070C39A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F15FC091EBF7DE612A84F1B9 /* Pods-Lock.release.xcconfig */; + baseConfigurationReference = 572EFC8AFE63EBB3FDFFF57D /* Pods-Lock.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -772,7 +772,7 @@ ); GOOGLE_PLUS_CLIENT_ID = "856630117504-sc8oovbfg7tl5fhqrbocee292inbuebq.apps.googleusercontent.com"; INFOPLIST_FILE = "Lock/Lock-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; PRODUCT_NAME = Lock; PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; @@ -781,7 +781,7 @@ }; 6003F5C3195388D20070C39A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4FE86D747F16255659237957 /* Pods-Tests.debug.xcconfig */; + baseConfigurationReference = 936C8D67A8F69B5F417E3BDC /* Pods-Tests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Lock.app/Lock"; CLANG_ENABLE_MODULES = YES; @@ -806,7 +806,7 @@ }; 6003F5C4195388D20070C39A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3EA2B89CABCA670E8559CCE5 /* Pods-Tests.release.xcconfig */; + baseConfigurationReference = 98764BA81EB282D5246EB984 /* Pods-Tests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Lock.app/Lock"; CLANG_ENABLE_MODULES = YES; diff --git a/Lock/Lock/A0HomeViewController.h b/Lock/Lock/A0HomeViewController.h index 0a9f221c6..e5039ceb0 100644 --- a/Lock/Lock/A0HomeViewController.h +++ b/Lock/Lock/A0HomeViewController.h @@ -30,5 +30,6 @@ - (IBAction)loginNative:(id)sender; - (IBAction)loginTouchID:(id)sender; - (IBAction)loginSMS:(id)sender; +- (IBAction)loginEmail:(id)sender; @end diff --git a/Lock/Lock/A0HomeViewController.m b/Lock/Lock/A0HomeViewController.m index 536ee23b7..eff3c8f75 100644 --- a/Lock/Lock/A0HomeViewController.m +++ b/Lock/Lock/A0HomeViewController.m @@ -29,10 +29,6 @@ #import #import "A0LockApplication.h" -#if __has_include() -#define TOUCH_ID 1 -#endif - #define kClientIdKey @"Auth0ClientId" #define kTenantKey @"Auth0Tenant" @@ -105,7 +101,6 @@ - (void)loginNative:(id)sender { - (void)loginTouchID:(id)sender { [self.keychain clearAll]; -#ifdef TOUCHID A0Lock *lock = [[A0LockApplication sharedInstance] lock]; A0TouchIDLockViewController *controller = [lock newTouchIDViewController]; @@ -122,7 +117,6 @@ - (void)loginTouchID:(id)sender { }]; }; [lock presentTouchIDController:controller fromController:self]; -#endif } - (void)loginSMS:(id)sender { @@ -143,4 +137,24 @@ - (void)loginSMS:(id)sender { }; [lock presentSMSController:controller fromController:self]; } + +- (void)loginEmail:(id)sender { + [self.keychain clearAll]; + A0Lock *lock = [[A0LockApplication sharedInstance] lock]; + A0EmailLockViewController *controller = [lock newEmailViewController]; + controller.closable = YES; + @weakify(self); + controller.onAuthenticationBlock = ^(A0UserProfile *profile, A0Token *token) { + NSLog(@"SUCCESS %@", profile); + @strongify(self); + [self.keychain setString:token.idToken forKey:@"id_token"]; + [self.keychain setString:token.refreshToken forKey:@"refresh_token"]; + [self.keychain setData:[NSKeyedArchiver archivedDataWithRootObject:profile] forKey:@"profile"]; + [self dismissViewControllerAnimated:YES completion:^(){ + [self performSegueWithIdentifier:@"LoggedIn" sender:self]; + }]; + }; + [lock presentEmailController:controller fromController:self]; +} + @end diff --git a/Lock/Lock/Base.lproj/Main.storyboard b/Lock/Lock/Base.lproj/Main.storyboard index eb1f0b547..ed008c283 100644 --- a/Lock/Lock/Base.lproj/Main.storyboard +++ b/Lock/Lock/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -16,48 +17,48 @@ - + - + - + - + @@ -109,7 +110,7 @@ - + - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -313,7 +249,7 @@ - + @@ -328,7 +264,7 @@ - + @@ -471,7 +407,7 @@ - + - + @@ -537,7 +473,7 @@