Skip to content

Commit

Permalink
Added user authentication and UI to register user in Cognito
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan-Shah committed May 10, 2020
1 parent 57a6a76 commit 054cc30
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ awsconfiguration.json
amplifyconfiguration.json
amplify-build-config.json
amplify-gradle-config.json
amplifyxc.config
amplifyxc.config
Pods
19 changes: 19 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Postfeed' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Postfeed
pod 'AWSMobileClient'
pod 'AWSUserPoolsSignIn'
pod 'AWSAuthUI'


target 'PostfeedTests' do
inherit! :search_paths
# Pods for testing
end

end
45 changes: 45 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
PODS:
- AWSAuthCore (2.13.3):
- AWSCore (= 2.13.3)
- AWSAuthUI (2.13.3):
- AWSAuthCore (= 2.13.3)
- AWSCore (= 2.13.3)
- AWSCognitoIdentityProvider (2.13.3):
- AWSCognitoIdentityProviderASF (= 1.0.1)
- AWSCore (= 2.13.3)
- AWSCognitoIdentityProviderASF (1.0.1)
- AWSCore (2.13.3)
- AWSMobileClient (2.13.3):
- AWSAuthCore (= 2.13.3)
- AWSCognitoIdentityProvider (= 2.13.3)
- AWSUserPoolsSignIn (2.13.3):
- AWSAuthCore (= 2.13.3)
- AWSCognitoIdentityProvider (= 2.13.3)

DEPENDENCIES:
- AWSAuthUI
- AWSMobileClient
- AWSUserPoolsSignIn

SPEC REPOS:
trunk:
- AWSAuthCore
- AWSAuthUI
- AWSCognitoIdentityProvider
- AWSCognitoIdentityProviderASF
- AWSCore
- AWSMobileClient
- AWSUserPoolsSignIn

SPEC CHECKSUMS:
AWSAuthCore: 93b71ac38596e75790015c7299c725bb09ae1d5f
AWSAuthUI: 606e0585daf951db263e098a792aad44b21476bd
AWSCognitoIdentityProvider: 3480819d983e78eda7a43e141273756784be30cb
AWSCognitoIdentityProviderASF: f94f1a502e72ef3d0a1de93e10bf7a79c8698118
AWSCore: fc361166b595e3c0183c55987743b295646c39d2
AWSMobileClient: 9149b664d1a89279bd49d36598c7afc38a63d7d1
AWSUserPoolsSignIn: b32e3c69bb29618434da9b3b0367ccc214d85fc8

PODFILE CHECKSUM: 5015462aa2f364068172faf780ed18ecd980f58f

COCOAPODS: 1.9.1
101 changes: 100 additions & 1 deletion Postfeed.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
136C436E246850C500630E51 /* awsconfiguration.json in Resources */ = {isa = PBXBuildFile; fileRef = 136C436D246850C500630E51 /* awsconfiguration.json */; };
13B62B02246831F9004ACD82 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13B62B01246831F9004ACD82 /* AppDelegate.swift */; };
13B62B04246831F9004ACD82 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13B62B03246831F9004ACD82 /* SceneDelegate.swift */; };
13B62B06246831F9004ACD82 /* FeedTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13B62B05246831F9004ACD82 /* FeedTableViewController.swift */; };
Expand All @@ -20,6 +21,8 @@
13B62B2F246836C3004ACD82 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13B62B2E246836C3004ACD82 /* SettingsViewController.swift */; };
13B62B32246836F7004ACD82 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13B62B31246836F7004ACD82 /* CoreLocation.framework */; };
13B62B34246836FE004ACD82 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13B62B33246836FE004ACD82 /* MapKit.framework */; };
D33725764F6F656937838DED /* Pods_PostfeedTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CBBC4D4E6B39A08DC972B0E /* Pods_PostfeedTests.framework */; };
EF76758AE34D85B3318EF64B /* Pods_Postfeed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C6C28123242580EF209215 /* Pods_Postfeed.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -33,6 +36,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
136C436D246850C500630E51 /* awsconfiguration.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = awsconfiguration.json; path = ../awsconfiguration.json; sourceTree = "<group>"; };
13B62AFE246831F9004ACD82 /* Postfeed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Postfeed.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B62B01246831F9004ACD82 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
13B62B03246831F9004ACD82 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -50,6 +54,12 @@
13B62B2E246836C3004ACD82 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
13B62B31246836F7004ACD82 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
13B62B33246836FE004ACD82 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
1CBBC4D4E6B39A08DC972B0E /* Pods_PostfeedTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PostfeedTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
55C6C28123242580EF209215 /* Pods_Postfeed.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Postfeed.framework; sourceTree = BUILT_PRODUCTS_DIR; };
67BD5F1BB23523A309D00121 /* Pods-PostfeedTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PostfeedTests.debug.xcconfig"; path = "Target Support Files/Pods-PostfeedTests/Pods-PostfeedTests.debug.xcconfig"; sourceTree = "<group>"; };
A854B1D99DB095CC6E294102 /* Pods-PostfeedTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PostfeedTests.release.xcconfig"; path = "Target Support Files/Pods-PostfeedTests/Pods-PostfeedTests.release.xcconfig"; sourceTree = "<group>"; };
CC7133BA9D08478F2AD94422 /* Pods-Postfeed.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Postfeed.release.xcconfig"; path = "Target Support Files/Pods-Postfeed/Pods-Postfeed.release.xcconfig"; sourceTree = "<group>"; };
F8760F9CA946CD8B037A59E1 /* Pods-Postfeed.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Postfeed.debug.xcconfig"; path = "Target Support Files/Pods-Postfeed/Pods-Postfeed.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -59,13 +69,15 @@
files = (
13B62B34246836FE004ACD82 /* MapKit.framework in Frameworks */,
13B62B32246836F7004ACD82 /* CoreLocation.framework in Frameworks */,
EF76758AE34D85B3318EF64B /* Pods_Postfeed.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B62B11246831FD004ACD82 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D33725764F6F656937838DED /* Pods_PostfeedTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -79,6 +91,7 @@
13B62B17246831FD004ACD82 /* PostfeedTests */,
13B62AFF246831F9004ACD82 /* Products */,
13B62B30246836F7004ACD82 /* Frameworks */,
BFB9B196AF5AF259A76E7236 /* Pods */,
);
sourceTree = "<group>";
};
Expand All @@ -94,6 +107,7 @@
13B62B00246831F9004ACD82 /* Postfeed */ = {
isa = PBXGroup;
children = (
136C436D246850C500630E51 /* awsconfiguration.json */,
13B62B2324683597004ACD82 /* Application */,
13B62B25246835C7004ACD82 /* Feed */,
13B62B24246835A3004ACD82 /* Settings */,
Expand Down Expand Up @@ -163,20 +177,35 @@
children = (
13B62B33246836FE004ACD82 /* MapKit.framework */,
13B62B31246836F7004ACD82 /* CoreLocation.framework */,
55C6C28123242580EF209215 /* Pods_Postfeed.framework */,
1CBBC4D4E6B39A08DC972B0E /* Pods_PostfeedTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
BFB9B196AF5AF259A76E7236 /* Pods */ = {
isa = PBXGroup;
children = (
F8760F9CA946CD8B037A59E1 /* Pods-Postfeed.debug.xcconfig */,
CC7133BA9D08478F2AD94422 /* Pods-Postfeed.release.xcconfig */,
67BD5F1BB23523A309D00121 /* Pods-PostfeedTests.debug.xcconfig */,
A854B1D99DB095CC6E294102 /* Pods-PostfeedTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
13B62AFD246831F9004ACD82 /* Postfeed */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B62B1D246831FD004ACD82 /* Build configuration list for PBXNativeTarget "Postfeed" */;
buildPhases = (
B22050265F6CF608894E6715 /* [CP] Check Pods Manifest.lock */,
13B62AFA246831F9004ACD82 /* Sources */,
13B62AFB246831F9004ACD82 /* Frameworks */,
13B62AFC246831F9004ACD82 /* Resources */,
337502B0EABB502559A9E28A /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -191,6 +220,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B62B20246831FD004ACD82 /* Build configuration list for PBXNativeTarget "PostfeedTests" */;
buildPhases = (
B46A203192D063C2B958B53A /* [CP] Check Pods Manifest.lock */,
13B62B10246831FD004ACD82 /* Sources */,
13B62B11246831FD004ACD82 /* Frameworks */,
13B62B12246831FD004ACD82 /* Resources */,
Expand Down Expand Up @@ -248,6 +278,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
136C436E246850C500630E51 /* awsconfiguration.json in Resources */,
13B62B0E246831FD004ACD82 /* LaunchScreen.storyboard in Resources */,
13B62B0B246831FD004ACD82 /* Assets.xcassets in Resources */,
13B62B09246831FA004ACD82 /* Main.storyboard in Resources */,
Expand All @@ -263,6 +294,70 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
337502B0EABB502559A9E28A /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Postfeed/Pods-Postfeed-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Postfeed/Pods-Postfeed-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Postfeed/Pods-Postfeed-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
B22050265F6CF608894E6715 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Postfeed-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B46A203192D063C2B958B53A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-PostfeedTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
13B62AFA246831F9004ACD82 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -432,6 +527,7 @@
};
13B62B1E246831FD004ACD82 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F8760F9CA946CD8B037A59E1 /* Pods-Postfeed.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
Expand All @@ -450,6 +546,7 @@
};
13B62B1F246831FD004ACD82 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = CC7133BA9D08478F2AD94422 /* Pods-Postfeed.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
Expand All @@ -468,6 +565,7 @@
};
13B62B21246831FD004ACD82 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 67BD5F1BB23523A309D00121 /* Pods-PostfeedTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
Expand All @@ -490,6 +588,7 @@
};
13B62B22246831FD004ACD82 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A854B1D99DB095CC6E294102 /* Pods-PostfeedTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>Postfeed.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>11</integer>
</dict>
</dict>
</dict>
Expand Down
10 changes: 10 additions & 0 deletions Postfeed.xcworkspace/contents.xcworkspacedata

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

8 changes: 8 additions & 0 deletions Postfeed.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "34E59211-64CB-42ED-8B34-33AB0C13A028"
type = "0"
version = "2.0">
</Bucket>
10 changes: 10 additions & 0 deletions Postfeed/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@
//

import UIKit
import AWSMobileClient

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

AWSMobileClient.default().initialize { (userState, error) in
if let userState = userState {
print("UserState: \(userState.rawValue)")
} else if let error = error {
print("error: \(error.localizedDescription)")
}
}

return true
}

Expand Down
Loading

0 comments on commit 054cc30

Please sign in to comment.