Skip to content

Commit 2327523

Browse files
authored
chore: add sample app (#19)
1 parent f160fe5 commit 2327523

30 files changed

+2045
-0
lines changed

HostApp/HostApp.xcodeproj/project.pbxproj

Lines changed: 769 additions & 0 deletions
Large diffs are not rendered by default.

HostApp/HostApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

HostApp/HostApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 113 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1410"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "9070FF9F285112B4009867D5"
18+
BuildableName = "HostApp.app"
19+
BlueprintName = "HostApp"
20+
ReferencedContainer = "container:HostApp.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "9070FFAF285112B5009867D5"
36+
BuildableName = "HostAppTests.xctest"
37+
BlueprintName = "HostAppTests"
38+
ReferencedContainer = "container:HostApp.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
<TestableReference
42+
skipped = "NO">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "9070FFB9285112B5009867D5"
46+
BuildableName = "HostAppUITests.xctest"
47+
BlueprintName = "HostAppUITests"
48+
ReferencedContainer = "container:HostApp.xcodeproj">
49+
</BuildableReference>
50+
</TestableReference>
51+
</Testables>
52+
</TestAction>
53+
<LaunchAction
54+
buildConfiguration = "Debug"
55+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
56+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
57+
launchStyle = "0"
58+
useCustomWorkingDirectory = "NO"
59+
ignoresPersistentStateOnLaunch = "NO"
60+
debugDocumentVersioning = "YES"
61+
debugServiceExtension = "internal"
62+
enableGPUValidationMode = "1"
63+
allowLocationSimulation = "YES">
64+
<BuildableProductRunnable
65+
runnableDebuggingMode = "0">
66+
<BuildableReference
67+
BuildableIdentifier = "primary"
68+
BlueprintIdentifier = "9070FF9F285112B4009867D5"
69+
BuildableName = "HostApp.app"
70+
BlueprintName = "HostApp"
71+
ReferencedContainer = "container:HostApp.xcodeproj">
72+
</BuildableReference>
73+
</BuildableProductRunnable>
74+
<CommandLineArguments>
75+
<CommandLineArgument
76+
argument = "LANDMARK_DEBUG_MODE"
77+
isEnabled = "NO">
78+
</CommandLineArgument>
79+
</CommandLineArguments>
80+
</LaunchAction>
81+
<ProfileAction
82+
buildConfiguration = "Release"
83+
shouldUseLaunchSchemeArgsEnv = "YES"
84+
savedToolIdentifier = ""
85+
useCustomWorkingDirectory = "NO"
86+
debugDocumentVersioning = "YES">
87+
<BuildableProductRunnable
88+
runnableDebuggingMode = "0">
89+
<BuildableReference
90+
BuildableIdentifier = "primary"
91+
BlueprintIdentifier = "9070FF9F285112B4009867D5"
92+
BuildableName = "HostApp.app"
93+
BlueprintName = "HostApp"
94+
ReferencedContainer = "container:HostApp.xcodeproj">
95+
</BuildableReference>
96+
</BuildableProductRunnable>
97+
</ProfileAction>
98+
<AnalyzeAction
99+
buildConfiguration = "Debug">
100+
</AnalyzeAction>
101+
<ArchiveAction
102+
buildConfiguration = "Release"
103+
revealArchiveInOrganizer = "YES">
104+
</ArchiveAction>
105+
</Scheme>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
}
8+
],
9+
"info" : {
10+
"author" : "xcode",
11+
"version" : 1
12+
}
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}

HostApp/HostApp/HostApp.entitlements

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>keychain-access-groups</key>
6+
<array>
7+
<string>$(AppIdentifierPrefix)com.amazonaws.mobile.amplify.liveness.testing.hostapp</string>
8+
</array>
9+
</dict>
10+
</plist>

HostApp/HostApp/HostAppApp.swift

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import SwiftUI
9+
import FaceLiveness
10+
import Amplify
11+
import AWSCognitoAuthPlugin
12+
import AWSAPIPlugin
13+
14+
@main
15+
struct HostAppApp: App {
16+
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
17+
18+
func increaseBrightness() {
19+
UIScreen.main.brightness = 1.0
20+
}
21+
22+
var body: some Scene {
23+
WindowGroup {
24+
RootView()
25+
}
26+
}
27+
28+
init() {
29+
do {
30+
let auth = AWSCognitoAuthPlugin()
31+
let api = AWSAPIPlugin()
32+
try Amplify.add(plugin: auth)
33+
try Amplify.add(plugin: api)
34+
try Amplify.configure()
35+
} catch {
36+
print("Error configuring Amplify", error)
37+
}
38+
}
39+
}
40+
41+
class AppDelegate: NSObject, UIApplicationDelegate {
42+
func application(
43+
_ application: UIApplication,
44+
configurationForConnecting connectingSceneSession: UISceneSession,
45+
options: UIScene.ConnectionOptions
46+
) -> UISceneConfiguration {
47+
let configuration = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)
48+
if connectingSceneSession.role == .windowApplication {
49+
configuration.delegateClass = SceneDelegate.self
50+
}
51+
return configuration
52+
}
53+
}
54+
55+
class SceneDelegate: NSObject, ObservableObject, UIWindowSceneDelegate {
56+
var window: UIWindow?
57+
58+
func scene(
59+
_ scene: UIScene,
60+
willConnectTo session: UISceneSession,
61+
options connectionOptions: UIScene.ConnectionOptions
62+
) {
63+
if #available(iOS 15.0, *) {
64+
self.window = (scene as? UIWindowScene)?.keyWindow
65+
} else {
66+
self.window = (scene as? UIWindowScene)?.windows
67+
.first(where: \.isKeyWindow)
68+
}
69+
}
70+
}
71+

0 commit comments

Comments
 (0)