Skip to content

Commit f0d8acc

Browse files
authored
Add upload functionality to performance quickstart [SwiftUI] (#1251)
* Add upload functionality * Update project * Update ui tests with upload functionality * Add readme * Remove ProcessAction and update UI tests * Reflect tvOS support * Update readme * Update readme * Add individual functionality tests to UI tests * Use FirebaseStorageSwift * Update upload status consistently
1 parent 7183040 commit f0d8acc

File tree

11 files changed

+549
-202
lines changed

11 files changed

+549
-202
lines changed

performance/SwiftUIPerformanceQuickstart/PerformanceExample/PerformanceExample.xcodeproj/project.pbxproj

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 55;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
4102056426A631F5004B24B3 /* PerformanceExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4102055626A631F4004B24B3 /* PerformanceExampleApp.swift */; };
11-
4102056626A631F5004B24B3 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4102055726A631F4004B24B3 /* MainView.swift */; };
1211
4102056826A631F5004B24B3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4102055826A631F5004B24B3 /* Assets.xcassets */; };
12+
41292E9C26CB623B00747458 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9826CB623B00747458 /* MainView.swift */; };
13+
41292E9D26CB623B00747458 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9826CB623B00747458 /* MainView.swift */; };
14+
41292E9E26CB623B00747458 /* UploadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9926CB623B00747458 /* UploadView.swift */; };
15+
41292E9F26CB623B00747458 /* UploadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9926CB623B00747458 /* UploadView.swift */; };
16+
41292EA026CB623B00747458 /* ClassifyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9A26CB623B00747458 /* ClassifyView.swift */; };
17+
41292EA126CB623B00747458 /* ClassifyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9A26CB623B00747458 /* ClassifyView.swift */; };
18+
41292EA226CB623B00747458 /* DownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9B26CB623B00747458 /* DownloadView.swift */; };
19+
41292EA326CB623B00747458 /* DownloadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41292E9B26CB623B00747458 /* DownloadView.swift */; };
1320
419700ED26C30DA500F186C3 /* UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 419700EC26C30DA500F186C3 /* UITests.swift */; };
1421
419700EE26C30DA500F186C3 /* UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 419700EC26C30DA500F186C3 /* UITests.swift */; };
1522
419AADCE26B86A94005C4817 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 419AADCD26B86A94005C4817 /* GoogleService-Info.plist */; };
1623
419AADCF26B86A94005C4817 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 419AADCD26B86A94005C4817 /* GoogleService-Info.plist */; };
1724
41BFA1EA26B1D36C0013EB90 /* PerformanceExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4102055626A631F4004B24B3 /* PerformanceExampleApp.swift */; };
18-
41BFA1EB26B1D3700013EB90 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4102055726A631F4004B24B3 /* MainView.swift */; };
1925
41BFA1EC26B1D3730013EB90 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4102055826A631F5004B24B3 /* Assets.xcassets */; };
2026
41BFA1F026B1D8B80013EB90 /* Process.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41BFA1EF26B1D8B80013EB90 /* Process.swift */; };
2127
41BFA1F326B1D8B80013EB90 /* Process.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41BFA1EF26B1D8B80013EB90 /* Process.swift */; };
@@ -40,11 +46,15 @@
4046

4147
/* Begin PBXFileReference section */
4248
4102055626A631F4004B24B3 /* PerformanceExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PerformanceExampleApp.swift; sourceTree = "<group>"; };
43-
4102055726A631F4004B24B3 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
4449
4102055826A631F5004B24B3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4550
4102055D26A631F5004B24B3 /* PerformanceExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerformanceExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
4651
4102057626A63210004B24B3 /* Tests_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4752
410FF76926B1CEB500CA084F /* PerformanceExample (tvOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PerformanceExample (tvOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
53+
41292E9826CB623B00747458 /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MainView.swift; path = Shared/Views/MainView.swift; sourceTree = "<group>"; };
54+
41292E9926CB623B00747458 /* UploadView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UploadView.swift; path = Shared/Views/UploadView.swift; sourceTree = "<group>"; };
55+
41292E9A26CB623B00747458 /* ClassifyView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ClassifyView.swift; path = Shared/Views/ClassifyView.swift; sourceTree = "<group>"; };
56+
41292E9B26CB623B00747458 /* DownloadView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DownloadView.swift; path = Shared/Views/DownloadView.swift; sourceTree = "<group>"; };
57+
41292EA526CB63B300747458 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
4858
413CB73826B4AE8200E995E2 /* PerformanceExample--tvOS--Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "PerformanceExample--tvOS--Info.plist"; sourceTree = "<group>"; };
4959
414C55A426B87EFB00114089 /* Tests_tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests_tvOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5060
419700EC26C30DA500F186C3 /* UITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITests.swift; sourceTree = "<group>"; };
@@ -87,6 +97,7 @@
8797
4102055026A631F4004B24B3 = {
8898
isa = PBXGroup;
8999
children = (
100+
41292EA526CB63B300747458 /* README.md */,
90101
419AADCD26B86A94005C4817 /* GoogleService-Info.plist */,
91102
413CB73826B4AE8200E995E2 /* PerformanceExample--tvOS--Info.plist */,
92103
4102055526A631F4004B24B3 /* Shared */,
@@ -97,8 +108,8 @@
97108
4102055526A631F4004B24B3 /* Shared */ = {
98109
isa = PBXGroup;
99110
children = (
111+
41292EA426CB624000747458 /* Views */,
100112
4102055626A631F4004B24B3 /* PerformanceExampleApp.swift */,
101-
4102055726A631F4004B24B3 /* MainView.swift */,
102113
41BFA1EF26B1D8B80013EB90 /* Process.swift */,
103114
419700EC26C30DA500F186C3 /* UITests.swift */,
104115
4102055826A631F5004B24B3 /* Assets.xcassets */,
@@ -117,20 +128,16 @@
117128
name = Products;
118129
sourceTree = "<group>";
119130
};
120-
4102057726A63210004B24B3 /* Tests_iOS */ = {
131+
41292EA426CB624000747458 /* Views */ = {
121132
isa = PBXGroup;
122133
children = (
123-
4102057826A63210004B24B3 /* Tests_iOS.swift */,
134+
41292E9A26CB623B00747458 /* ClassifyView.swift */,
135+
41292E9B26CB623B00747458 /* DownloadView.swift */,
136+
41292E9826CB623B00747458 /* MainView.swift */,
137+
41292E9926CB623B00747458 /* UploadView.swift */,
124138
);
125-
path = Tests_iOS;
126-
sourceTree = "<group>";
127-
};
128-
414C55A526B87EFB00114089 /* Tests_tvOS */ = {
129-
isa = PBXGroup;
130-
children = (
131-
414C55A626B87EFB00114089 /* Tests_tvOS.swift */,
132-
);
133-
path = Tests_tvOS;
139+
name = Views;
140+
path = ..;
134141
sourceTree = "<group>";
135142
};
136143
/* End PBXGroup section */
@@ -295,7 +302,10 @@
295302
isa = PBXSourcesBuildPhase;
296303
buildActionMask = 2147483647;
297304
files = (
298-
4102056626A631F5004B24B3 /* MainView.swift in Sources */,
305+
41292E9E26CB623B00747458 /* UploadView.swift in Sources */,
306+
41292EA026CB623B00747458 /* ClassifyView.swift in Sources */,
307+
41292E9C26CB623B00747458 /* MainView.swift in Sources */,
308+
41292EA226CB623B00747458 /* DownloadView.swift in Sources */,
299309
4102056426A631F5004B24B3 /* PerformanceExampleApp.swift in Sources */,
300310
41BFA1F026B1D8B80013EB90 /* Process.swift in Sources */,
301311
);
@@ -313,7 +323,10 @@
313323
isa = PBXSourcesBuildPhase;
314324
buildActionMask = 2147483647;
315325
files = (
316-
41BFA1EB26B1D3700013EB90 /* MainView.swift in Sources */,
326+
41292E9F26CB623B00747458 /* UploadView.swift in Sources */,
327+
41292EA126CB623B00747458 /* ClassifyView.swift in Sources */,
328+
41292E9D26CB623B00747458 /* MainView.swift in Sources */,
329+
41292EA326CB623B00747458 /* DownloadView.swift in Sources */,
317330
41BFA1EA26B1D36C0013EB90 /* PerformanceExampleApp.swift in Sources */,
318331
41BFA1F326B1D8B80013EB90 /* Process.swift in Sources */,
319332
);

performance/SwiftUIPerformanceQuickstart/PerformanceExample/Podfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use_frameworks!
22

33
pod 'Firebase'
44
pod 'FirebasePerformance'
5+
pod 'FirebaseStorage'
6+
pod 'FirebaseStorageSwift', '> 8.0-beta'
57

68
target 'PerformanceExample (iOS)' do
79
target 'Tests_iOS' do

performance/SwiftUIPerformanceQuickstart/PerformanceExample/Podfile.lock

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ PODS:
5555
- FirebaseInstallations (~> 8.0)
5656
- GoogleUtilities/Environment (~> 7.4)
5757
- "GoogleUtilities/NSData+zlib (~> 7.4)"
58+
- FirebaseStorage (8.5.0):
59+
- FirebaseCore (~> 8.0)
60+
- GTMSessionFetcher/Core (~> 1.5)
61+
- FirebaseStorageSwift (8.5.0-beta):
62+
- FirebaseStorage (~> 8.0)
5863
- GoogleAppMeasurement (8.5.0):
5964
- GoogleAppMeasurement/AdIdSupport (= 8.5.0)
6065
- GoogleUtilities/AppDelegateSwizzler (~> 7.4)
@@ -92,6 +97,7 @@ PODS:
9297
- GoogleUtilities/Logger
9398
- GoogleUtilities/UserDefaults (7.5.0):
9499
- GoogleUtilities/Logger
100+
- GTMSessionFetcher/Core (1.6.1)
95101
- nanopb (2.30908.0):
96102
- nanopb/decode (= 2.30908.0)
97103
- nanopb/encode (= 2.30908.0)
@@ -103,6 +109,8 @@ PODS:
103109
DEPENDENCIES:
104110
- Firebase
105111
- FirebasePerformance
112+
- FirebaseStorage
113+
- FirebaseStorageSwift (> 8.0-beta)
106114

107115
SPEC REPOS:
108116
trunk:
@@ -114,9 +122,12 @@ SPEC REPOS:
114122
- FirebaseInstallations
115123
- FirebasePerformance
116124
- FirebaseRemoteConfig
125+
- FirebaseStorage
126+
- FirebaseStorageSwift
117127
- GoogleAppMeasurement
118128
- GoogleDataTransport
119129
- GoogleUtilities
130+
- GTMSessionFetcher
120131
- nanopb
121132
- PromisesObjC
122133
- Protobuf
@@ -130,13 +141,16 @@ SPEC CHECKSUMS:
130141
FirebaseInstallations: f2bc590b291d25fb40a9a05b8281c02a881b5117
131142
FirebasePerformance: f714a631ddef36758d34107ebb60ce324c7428cc
132143
FirebaseRemoteConfig: 693c1f150408e9a727daf4d8c55c7f9c29ef9ad5
144+
FirebaseStorage: 2c176ca64a68b45bddc3c7d4d2c0c839927ad92c
145+
FirebaseStorageSwift: 908b7855270dc0b20d782b453cef69da66b2155a
133146
GoogleAppMeasurement: 8d10c1c470fcb0e5143ed74fddd164f0a0384800
134147
GoogleDataTransport: 85fd18ff3019bb85d3f2c551d04c481dedf71fc9
135148
GoogleUtilities: eea970f4a389963963bffe8d8fabe43540678b9c
149+
GTMSessionFetcher: 36689134877faeb055b27dfa4ccc9ceaa42e029e
136150
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
137151
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
138152
Protobuf: 7327d4444215b5f18e560a97f879ff5503c4581c
139153

140-
PODFILE CHECKSUM: c3c7c6c73a08055f2aed45a22a0e7e648458d45e
154+
PODFILE CHECKSUM: 568442141feded491012db355675b32788621c19
141155

142-
COCOAPODS: 1.10.1
156+
COCOAPODS: 1.10.2
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Firebase Performance Monitoring Quickstart
2+
=============================
3+
4+
# Firebase Performance Monitoring
5+
6+
Firebase Performance Monitoring is a free mobile app performance analytics service. It
7+
provides detailed information about the performance of your apps (app start, network requests, screen performance) automatically,
8+
while also allowing you to measure the performance of any piece of code in your apps.
9+
10+
Introduction
11+
------------
12+
13+
- [Read more about Firebase Performance Monitoring](https://firebase.google.com/docs/perf-mon/)
14+
15+
Getting Started
16+
---------------
17+
18+
- [Add Firebase to your iOS / tvOS Project](https://firebase.google.com/docs/ios/setup).
19+
- [Create a default Cloud Storage bucket](https://firebase.google.com/docs/storage/ios/start#create-default-bucket).
20+
- [Replace your Rules](https://firebase.google.com/docs/storage/security/get-started#access_your_rules) with the following:
21+
```
22+
rules_version = '2';
23+
service firebase.storage {
24+
match /b/{bucket}/o {
25+
match /image.jpg {
26+
allow create: if request.resource.contentType == 'image/jpeg'
27+
}
28+
}
29+
}
30+
```
31+
- Run the sample on your iOS / tvOS device or simulator.
32+
33+
34+
Support
35+
-------
36+
37+
- [Firebase Support](https://firebase.google.com/support/)
38+
39+
License
40+
-------
41+
42+
Copyright 2021 Google LLC
43+
44+
Licensed under the Apache License, Version 2.0 (the "License");
45+
you may not use this file except in compliance with the License.
46+
You may obtain a copy of the License at
47+
48+
http://www.apache.org/licenses/LICENSE-2.0
49+
50+
Unless required by applicable law or agreed to in writing, software
51+
distributed under the License is distributed on an "AS IS" BASIS,
52+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53+
See the License for the specific language governing permissions and
54+
limitations under the License.

performance/SwiftUIPerformanceQuickstart/PerformanceExample/Shared/MainView.swift

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)