Skip to content

Commit c4f8209

Browse files
authored
[Infra] Convert App Check sample app to SwiftUI (#14769)
1 parent 50d953b commit c4f8209

File tree

7 files changed

+90
-99
lines changed

7 files changed

+90
-99
lines changed

FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp.xcodeproj/project.pbxproj

+32-29
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,49 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 60;
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
9A07E0572541D1B50076D8F5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9A07E0562541D1B50076D8F5 /* GoogleService-Info.plist */; };
1110
9AC7C27C2541C7E500F5DD80 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7C27B2541C7E500F5DD80 /* AppDelegate.swift */; };
1211
9AC7C27E2541C7E500F5DD80 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7C27D2541C7E500F5DD80 /* SceneDelegate.swift */; };
13-
9AC7C2802541C7E500F5DD80 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7C27F2541C7E500F5DD80 /* ViewController.swift */; };
14-
9AC7C2832541C7E500F5DD80 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AC7C2812541C7E500F5DD80 /* Main.storyboard */; };
1512
9AC7C2852541C7E600F5DD80 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AC7C2842541C7E600F5DD80 /* Assets.xcassets */; };
1613
9AC7C2882541C7E600F5DD80 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AC7C2862541C7E600F5DD80 /* LaunchScreen.storyboard */; };
14+
EAD122EF2DB97E10004D64C9 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = EAD122EE2DB97E10004D64C9 /* GoogleService-Info.plist */; };
15+
EAD122F12DB98BD0004D64C9 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAD122F02DB98BCC004D64C9 /* ContentView.swift */; };
16+
EAD122F32DB9920D004D64C9 /* AppCheckTestApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAD122F22DB99206004D64C9 /* AppCheckTestApp.swift */; };
17+
EAD122F62DB9940E004D64C9 /* FirebaseAppCheck in Frameworks */ = {isa = PBXBuildFile; productRef = EAD122F52DB9940E004D64C9 /* FirebaseAppCheck */; };
1718
/* End PBXBuildFile section */
1819

1920
/* Begin PBXFileReference section */
20-
9A07E0562541D1B50076D8F5 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
2121
9AC7C2782541C7E500F5DD80 /* FIRAppCheckTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FIRAppCheckTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
2222
9AC7C27B2541C7E500F5DD80 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2323
9AC7C27D2541C7E500F5DD80 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
24-
9AC7C27F2541C7E500F5DD80 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
25-
9AC7C2822541C7E500F5DD80 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
2624
9AC7C2842541C7E600F5DD80 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2725
9AC7C2872541C7E600F5DD80 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
2826
9AC7C2892541C7E600F5DD80 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
27+
EAD122EE2DB97E10004D64C9 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
28+
EAD122F02DB98BCC004D64C9 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
29+
EAD122F22DB99206004D64C9 /* AppCheckTestApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCheckTestApp.swift; sourceTree = "<group>"; };
2930
/* End PBXFileReference section */
3031

3132
/* Begin PBXFrameworksBuildPhase section */
3233
9AC7C2752541C7E500F5DD80 /* Frameworks */ = {
3334
isa = PBXFrameworksBuildPhase;
3435
buildActionMask = 2147483647;
3536
files = (
37+
EAD122F62DB9940E004D64C9 /* FirebaseAppCheck in Frameworks */,
3638
);
3739
runOnlyForDeploymentPostprocessing = 0;
3840
};
3941
/* End PBXFrameworksBuildPhase section */
4042

4143
/* Begin PBXGroup section */
42-
30221A668C12ED048788DFEB /* Pods */ = {
43-
isa = PBXGroup;
44-
children = (
45-
);
46-
path = Pods;
47-
sourceTree = "<group>";
48-
};
4944
9AC7C26F2541C7E500F5DD80 = {
5045
isa = PBXGroup;
5146
children = (
5247
9AC7C27A2541C7E500F5DD80 /* FIRAppCheckTestApp */,
5348
9AC7C2792541C7E500F5DD80 /* Products */,
54-
30221A668C12ED048788DFEB /* Pods */,
5549
);
5650
sourceTree = "<group>";
5751
};
@@ -66,14 +60,14 @@
6660
9AC7C27A2541C7E500F5DD80 /* FIRAppCheckTestApp */ = {
6761
isa = PBXGroup;
6862
children = (
63+
EAD122EE2DB97E10004D64C9 /* GoogleService-Info.plist */,
6964
9AC7C27B2541C7E500F5DD80 /* AppDelegate.swift */,
7065
9AC7C27D2541C7E500F5DD80 /* SceneDelegate.swift */,
71-
9AC7C27F2541C7E500F5DD80 /* ViewController.swift */,
72-
9AC7C2812541C7E500F5DD80 /* Main.storyboard */,
66+
EAD122F02DB98BCC004D64C9 /* ContentView.swift */,
67+
EAD122F22DB99206004D64C9 /* AppCheckTestApp.swift */,
7368
9AC7C2842541C7E600F5DD80 /* Assets.xcassets */,
7469
9AC7C2862541C7E600F5DD80 /* LaunchScreen.storyboard */,
7570
9AC7C2892541C7E600F5DD80 /* Info.plist */,
76-
9A07E0562541D1B50076D8F5 /* GoogleService-Info.plist */,
7771
);
7872
path = FIRAppCheckTestApp;
7973
sourceTree = "<group>";
@@ -121,6 +115,9 @@
121115
Base,
122116
);
123117
mainGroup = 9AC7C26F2541C7E500F5DD80;
118+
packageReferences = (
119+
EAD122F42DB9940E004D64C9 /* XCLocalSwiftPackageReference "../../../../firebase-ios-sdk" */,
120+
);
124121
productRefGroup = 9AC7C2792541C7E500F5DD80 /* Products */;
125122
projectDirPath = "";
126123
projectRoot = "";
@@ -136,9 +133,8 @@
136133
buildActionMask = 2147483647;
137134
files = (
138135
9AC7C2882541C7E600F5DD80 /* LaunchScreen.storyboard in Resources */,
136+
EAD122EF2DB97E10004D64C9 /* GoogleService-Info.plist in Resources */,
139137
9AC7C2852541C7E600F5DD80 /* Assets.xcassets in Resources */,
140-
9AC7C2832541C7E500F5DD80 /* Main.storyboard in Resources */,
141-
9A07E0572541D1B50076D8F5 /* GoogleService-Info.plist in Resources */,
142138
);
143139
runOnlyForDeploymentPostprocessing = 0;
144140
};
@@ -149,23 +145,16 @@
149145
isa = PBXSourcesBuildPhase;
150146
buildActionMask = 2147483647;
151147
files = (
152-
9AC7C2802541C7E500F5DD80 /* ViewController.swift in Sources */,
148+
EAD122F32DB9920D004D64C9 /* AppCheckTestApp.swift in Sources */,
153149
9AC7C27C2541C7E500F5DD80 /* AppDelegate.swift in Sources */,
150+
EAD122F12DB98BD0004D64C9 /* ContentView.swift in Sources */,
154151
9AC7C27E2541C7E500F5DD80 /* SceneDelegate.swift in Sources */,
155152
);
156153
runOnlyForDeploymentPostprocessing = 0;
157154
};
158155
/* End PBXSourcesBuildPhase section */
159156

160157
/* Begin PBXVariantGroup section */
161-
9AC7C2812541C7E500F5DD80 /* Main.storyboard */ = {
162-
isa = PBXVariantGroup;
163-
children = (
164-
9AC7C2822541C7E500F5DD80 /* Base */,
165-
);
166-
name = Main.storyboard;
167-
sourceTree = "<group>";
168-
};
169158
9AC7C2862541C7E600F5DD80 /* LaunchScreen.storyboard */ = {
170159
isa = PBXVariantGroup;
171160
children = (
@@ -357,6 +346,20 @@
357346
defaultConfigurationName = Release;
358347
};
359348
/* End XCConfigurationList section */
349+
350+
/* Begin XCLocalSwiftPackageReference section */
351+
EAD122F42DB9940E004D64C9 /* XCLocalSwiftPackageReference "../../../../firebase-ios-sdk" */ = {
352+
isa = XCLocalSwiftPackageReference;
353+
relativePath = "../../../../firebase-ios-sdk";
354+
};
355+
/* End XCLocalSwiftPackageReference section */
356+
357+
/* Begin XCSwiftPackageProductDependency section */
358+
EAD122F52DB9940E004D64C9 /* FirebaseAppCheck */ = {
359+
isa = XCSwiftPackageProductDependency;
360+
productName = FirebaseAppCheck;
361+
};
362+
/* End XCSwiftPackageProductDependency section */
360363
};
361364
rootObject = 9AC7C2702541C7E500F5DD80 /* Project object */;
362365
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import FirebaseCore
16+
import SwiftUI
17+
18+
@main
19+
struct FIRAppCheckTestApp: App {
20+
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
21+
22+
var body: some Scene {
23+
WindowGroup {
24+
ContentView()
25+
}
26+
}
27+
}

FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/AppDelegate.swift

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import UIKit
1919
import FirebaseAppCheck
2020
import FirebaseCore
2121

22-
@main
2322
class AppDelegate: UIResponder, UIApplicationDelegate {
2423
func application(_ application: UIApplication,
2524
didFinishLaunchingWithOptions launchOptions: [UIApplication

FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/Base.lproj/Main.storyboard

-24
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import FirebaseCore
16+
import SwiftUI
17+
18+
struct ContentView: View {
19+
var body: some View {
20+
VStack {
21+
Image(systemName: "globe")
22+
.imageScale(.large)
23+
Text("Hello, world!")
24+
}
25+
.padding()
26+
}
27+
}
28+
29+
#Preview {
30+
ContentView()
31+
}

FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/Info.plist

-21
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,10 @@
2020
<string>1</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
23-
<key>UIApplicationSceneManifest</key>
24-
<dict>
25-
<key>UIApplicationSupportsMultipleScenes</key>
26-
<false/>
27-
<key>UISceneConfigurations</key>
28-
<dict>
29-
<key>UIWindowSceneSessionRoleApplication</key>
30-
<array>
31-
<dict>
32-
<key>UISceneConfigurationName</key>
33-
<string>Default Configuration</string>
34-
<key>UISceneDelegateClassName</key>
35-
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
36-
<key>UISceneStoryboardFile</key>
37-
<string>Main</string>
38-
</dict>
39-
</array>
40-
</dict>
41-
</dict>
4223
<key>UIApplicationSupportsIndirectInputEvents</key>
4324
<true/>
4425
<key>UILaunchStoryboardName</key>
4526
<string>LaunchScreen</string>
46-
<key>UIMainStoryboardFile</key>
47-
<string>Main</string>
4827
<key>UIRequiredDeviceCapabilities</key>
4928
<array>
5029
<string>armv7</string>

FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/ViewController.swift

-24
This file was deleted.

0 commit comments

Comments
 (0)