Skip to content

Commit b163ec5

Browse files
authored
Firebase pod support for watchOS for RC and RTDB (#7841)
1 parent 4ac2833 commit b163ec5

File tree

6 files changed

+176
-2
lines changed

6 files changed

+176
-2
lines changed

.github/workflows/watchos-sample.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: watchos-sample
2+
3+
on:
4+
pull_request:
5+
paths:
6+
# Sources
7+
- 'FirebaseABTesting/**'
8+
- 'FirebaseDatabase/**'
9+
- 'FirebaseRemoteConfig/**'
10+
- 'FirebaseStorage/**'
11+
# Sample
12+
- 'Example/watchOSSample/**'
13+
# Firebase Podspec
14+
- 'Firebase.podspec'
15+
# This file
16+
- '.github/workflows/watchos-sample.yml'
17+
# Rebuild on Ruby infrastructure changes
18+
- 'Gemfile*'
19+
schedule:
20+
# Run every day at 10pm (PST) - cron uses UTC times
21+
- cron: '0 6 * * *'
22+
23+
jobs:
24+
25+
tv-sample-build-test:
26+
# Don't run on private repo unless it is a PR.
27+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
28+
runs-on: macos-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Setup Bundler
32+
run: scripts/setup_bundler.sh
33+
- name: Prereqs
34+
run: scripts/install_prereqs.sh WatchOSSample watchOS
35+
- name: Build
36+
run: ([ -z $plist_secret ] || scripts/build.sh WatchOSSample watchOS)

Example/watchOSSample/Podfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source 'https://cdn.cocoapods.org/'
55
use_frameworks!
66

77
target 'SampleWatchAppWatchKitExtension' do
8-
platform :watchos, '6.0'
8+
platform :watchos, '7.0'
99

1010
pod 'FirebaseCore', :path => '../../'
1111
pod 'FirebaseMessaging', :path => '../../'
@@ -15,12 +15,18 @@ target 'SampleWatchAppWatchKitExtension' do
1515
pod 'FirebaseStorage', :path => '../../'
1616
pod 'FirebaseRemoteConfig', :path => '../../'
1717
pod 'FirebaseABTesting', :path => '../../'
18+
pod 'FirebaseDatabase', :path => '../../'
1819

20+
pod 'Firebase/Messaging', :path => '../../'
21+
pod 'Firebase/Storage', :path => '../../'
22+
pod 'Firebase/RemoteConfig', :path => '../../'
23+
pod 'Firebase/ABTesting', :path => '../../'
24+
pod 'Firebase/Database', :path => '../../'
1925

2026
end
2127

2228
target 'ServiceExtension' do
23-
platform :watchos, '6.0'
29+
platform :watchos, '7.0'
2430
pod 'FirebaseMessaging', :path => '../../'
2531
pod 'FirebaseInstanceID', :path => '../../'
2632
end

Example/watchOSSample/SampleWatchApp.xcodeproj/project.pbxproj

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
0C2B2F85A0156FBA8723F203 /* Pods_SampleWatchAppWatchKitExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A1681F802CB688198BFE1E /* Pods_SampleWatchAppWatchKitExtension.framework */; };
1011
5156947923F4965000E7C350 /* SampleWatchAppWatchKitApp.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 5156947823F4965000E7C350 /* SampleWatchAppWatchKitApp.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
1112
5156947F23F4965000E7C350 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5156947D23F4965000E7C350 /* Interface.storyboard */; };
1213
5156948123F4965100E7C350 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5156948023F4965100E7C350 /* Assets.xcassets */; };
@@ -18,6 +19,7 @@
1819
5156949523F4965200E7C350 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5156949423F4965200E7C350 /* Assets.xcassets */; };
1920
515694AF23F4A3D200E7C350 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515694AE23F4A3D200E7C350 /* NotificationService.swift */; };
2021
515694B323F4A3D200E7C350 /* ServiceExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 515694AC23F4A3D200E7C350 /* ServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
22+
9C1E62C8ACA2E9975F320A8C /* Pods_ServiceExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EBA935736290F9E72DB25FF /* Pods_ServiceExtension.framework */; };
2123
/* End PBXBuildFile section */
2224

2325
/* Begin PBXContainerItemProxy section */
@@ -81,6 +83,7 @@
8183
/* End PBXCopyFilesBuildPhase section */
8284

8385
/* Begin PBXFileReference section */
86+
3EBA935736290F9E72DB25FF /* Pods_ServiceExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ServiceExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8487
5156947423F4965000E7C350 /* SampleWatchApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleWatchApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
8588
5156947823F4965000E7C350 /* SampleWatchAppWatchKitApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleWatchAppWatchKitApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
8689
5156947E23F4965000E7C350 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = "<group>"; };
@@ -98,6 +101,11 @@
98101
515694AC23F4A3D200E7C350 /* ServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
99102
515694AE23F4A3D200E7C350 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
100103
515694B023F4A3D200E7C350 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
104+
7FBA4340635BF194157452B9 /* Pods-SampleWatchAppWatchKitExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleWatchAppWatchKitExtension.release.xcconfig"; path = "Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension.release.xcconfig"; sourceTree = "<group>"; };
105+
C0064A1E379E237E54A9086B /* Pods-ServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ServiceExtension.debug.xcconfig"; path = "Target Support Files/Pods-ServiceExtension/Pods-ServiceExtension.debug.xcconfig"; sourceTree = "<group>"; };
106+
CB6479A86CC43D17D90F1E89 /* Pods-ServiceExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ServiceExtension.release.xcconfig"; path = "Target Support Files/Pods-ServiceExtension/Pods-ServiceExtension.release.xcconfig"; sourceTree = "<group>"; };
107+
D6A1681F802CB688198BFE1E /* Pods_SampleWatchAppWatchKitExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleWatchAppWatchKitExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
108+
DAE14C0BA7504E3EE4267A02 /* Pods-SampleWatchAppWatchKitExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleWatchAppWatchKitExtension.debug.xcconfig"; path = "Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension.debug.xcconfig"; sourceTree = "<group>"; };
101109
/* End PBXFileReference section */
102110

103111
/* Begin PBXFrameworksBuildPhase section */
@@ -112,13 +120,15 @@
112120
isa = PBXFrameworksBuildPhase;
113121
buildActionMask = 2147483647;
114122
files = (
123+
0C2B2F85A0156FBA8723F203 /* Pods_SampleWatchAppWatchKitExtension.framework in Frameworks */,
115124
);
116125
runOnlyForDeploymentPostprocessing = 0;
117126
};
118127
515694A923F4A3D200E7C350 /* Frameworks */ = {
119128
isa = PBXFrameworksBuildPhase;
120129
buildActionMask = 2147483647;
121130
files = (
131+
9C1E62C8ACA2E9975F320A8C /* Pods_ServiceExtension.framework in Frameworks */,
122132
);
123133
runOnlyForDeploymentPostprocessing = 0;
124134
};
@@ -132,13 +142,24 @@
132142
/* End PBXFrameworksBuildPhase section */
133143

134144
/* Begin PBXGroup section */
145+
203C8A236AE31151AAF474A5 /* Frameworks */ = {
146+
isa = PBXGroup;
147+
children = (
148+
D6A1681F802CB688198BFE1E /* Pods_SampleWatchAppWatchKitExtension.framework */,
149+
3EBA935736290F9E72DB25FF /* Pods_ServiceExtension.framework */,
150+
);
151+
name = Frameworks;
152+
sourceTree = "<group>";
153+
};
135154
5156946D23F4965000E7C350 = {
136155
isa = PBXGroup;
137156
children = (
138157
5156947C23F4965000E7C350 /* SampleWatchAppWatchKitApp */,
139158
5156948B23F4965100E7C350 /* SampleWatchAppWatchKitExtension */,
140159
515694AD23F4A3D200E7C350 /* ServiceExtension */,
141160
5156947523F4965000E7C350 /* Products */,
161+
BD04909E80693ABDC7D720F6 /* Pods */,
162+
203C8A236AE31151AAF474A5 /* Frameworks */,
142163
);
143164
sourceTree = "<group>";
144165
};
@@ -187,6 +208,18 @@
187208
path = ServiceExtension;
188209
sourceTree = "<group>";
189210
};
211+
BD04909E80693ABDC7D720F6 /* Pods */ = {
212+
isa = PBXGroup;
213+
children = (
214+
DAE14C0BA7504E3EE4267A02 /* Pods-SampleWatchAppWatchKitExtension.debug.xcconfig */,
215+
7FBA4340635BF194157452B9 /* Pods-SampleWatchAppWatchKitExtension.release.xcconfig */,
216+
C0064A1E379E237E54A9086B /* Pods-ServiceExtension.debug.xcconfig */,
217+
CB6479A86CC43D17D90F1E89 /* Pods-ServiceExtension.release.xcconfig */,
218+
);
219+
name = Pods;
220+
path = Pods;
221+
sourceTree = "<group>";
222+
};
190223
/* End PBXGroup section */
191224

192225
/* Begin PBXNativeTarget section */
@@ -230,10 +263,12 @@
230263
isa = PBXNativeTarget;
231264
buildConfigurationList = 5156949A23F4965200E7C350 /* Build configuration list for PBXNativeTarget "SampleWatchAppWatchKitExtension" */;
232265
buildPhases = (
266+
E5B1B049432440CF1A70B29A /* [CP] Check Pods Manifest.lock */,
233267
5156948323F4965100E7C350 /* Sources */,
234268
5156948423F4965100E7C350 /* Frameworks */,
235269
5156948523F4965100E7C350 /* Resources */,
236270
515694B723F4A3D200E7C350 /* Embed App Extensions */,
271+
1AC64D8D8CEC350A7BE652AA /* [CP] Embed Pods Frameworks */,
237272
);
238273
buildRules = (
239274
);
@@ -249,6 +284,7 @@
249284
isa = PBXNativeTarget;
250285
buildConfigurationList = 515694B423F4A3D200E7C350 /* Build configuration list for PBXNativeTarget "ServiceExtension" */;
251286
buildPhases = (
287+
36BFC0F6A337B1157B6D7C11 /* [CP] Check Pods Manifest.lock */,
252288
515694A823F4A3D200E7C350 /* Sources */,
253289
515694A923F4A3D200E7C350 /* Frameworks */,
254290
515694AA23F4A3D200E7C350 /* Resources */,
@@ -341,6 +377,70 @@
341377
};
342378
/* End PBXResourcesBuildPhase section */
343379

380+
/* Begin PBXShellScriptBuildPhase section */
381+
1AC64D8D8CEC350A7BE652AA /* [CP] Embed Pods Frameworks */ = {
382+
isa = PBXShellScriptBuildPhase;
383+
buildActionMask = 2147483647;
384+
files = (
385+
);
386+
inputFileListPaths = (
387+
"${PODS_ROOT}/Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension-frameworks-${CONFIGURATION}-input-files.xcfilelist",
388+
);
389+
name = "[CP] Embed Pods Frameworks";
390+
outputFileListPaths = (
391+
"${PODS_ROOT}/Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension-frameworks-${CONFIGURATION}-output-files.xcfilelist",
392+
);
393+
runOnlyForDeploymentPostprocessing = 0;
394+
shellPath = /bin/sh;
395+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension-frameworks.sh\"\n";
396+
showEnvVarsInLog = 0;
397+
};
398+
36BFC0F6A337B1157B6D7C11 /* [CP] Check Pods Manifest.lock */ = {
399+
isa = PBXShellScriptBuildPhase;
400+
buildActionMask = 2147483647;
401+
files = (
402+
);
403+
inputFileListPaths = (
404+
);
405+
inputPaths = (
406+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
407+
"${PODS_ROOT}/Manifest.lock",
408+
);
409+
name = "[CP] Check Pods Manifest.lock";
410+
outputFileListPaths = (
411+
);
412+
outputPaths = (
413+
"$(DERIVED_FILE_DIR)/Pods-ServiceExtension-checkManifestLockResult.txt",
414+
);
415+
runOnlyForDeploymentPostprocessing = 0;
416+
shellPath = /bin/sh;
417+
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";
418+
showEnvVarsInLog = 0;
419+
};
420+
E5B1B049432440CF1A70B29A /* [CP] Check Pods Manifest.lock */ = {
421+
isa = PBXShellScriptBuildPhase;
422+
buildActionMask = 2147483647;
423+
files = (
424+
);
425+
inputFileListPaths = (
426+
);
427+
inputPaths = (
428+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
429+
"${PODS_ROOT}/Manifest.lock",
430+
);
431+
name = "[CP] Check Pods Manifest.lock";
432+
outputFileListPaths = (
433+
);
434+
outputPaths = (
435+
"$(DERIVED_FILE_DIR)/Pods-SampleWatchAppWatchKitExtension-checkManifestLockResult.txt",
436+
);
437+
runOnlyForDeploymentPostprocessing = 0;
438+
shellPath = /bin/sh;
439+
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";
440+
showEnvVarsInLog = 0;
441+
};
442+
/* End PBXShellScriptBuildPhase section */
443+
344444
/* Begin PBXSourcesBuildPhase section */
345445
5156948323F4965100E7C350 /* Sources */ = {
346446
isa = PBXSourcesBuildPhase;
@@ -507,6 +607,7 @@
507607
};
508608
5156949B23F4965200E7C350 /* Debug */ = {
509609
isa = XCBuildConfiguration;
610+
baseConfigurationReference = DAE14C0BA7504E3EE4267A02 /* Pods-SampleWatchAppWatchKitExtension.debug.xcconfig */;
510611
buildSettings = {
511612
ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
512613
CODE_SIGN_ENTITLEMENTS = SampleWatchAppWatchKitExtension/SampleWatchAppWatchKitExtension.entitlements;
@@ -532,6 +633,7 @@
532633
};
533634
5156949C23F4965200E7C350 /* Release */ = {
534635
isa = XCBuildConfiguration;
636+
baseConfigurationReference = 7FBA4340635BF194157452B9 /* Pods-SampleWatchAppWatchKitExtension.release.xcconfig */;
535637
buildSettings = {
536638
ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
537639
CODE_SIGN_ENTITLEMENTS = SampleWatchAppWatchKitExtension/SampleWatchAppWatchKitExtension.entitlements;
@@ -629,6 +731,7 @@
629731
};
630732
515694B523F4A3D200E7C350 /* Debug */ = {
631733
isa = XCBuildConfiguration;
734+
baseConfigurationReference = C0064A1E379E237E54A9086B /* Pods-ServiceExtension.debug.xcconfig */;
632735
buildSettings = {
633736
CODE_SIGN_IDENTITY = "Apple Development";
634737
CODE_SIGN_STYLE = Manual;
@@ -653,6 +756,7 @@
653756
};
654757
515694B623F4A3D200E7C350 /* Release */ = {
655758
isa = XCBuildConfiguration;
759+
baseConfigurationReference = CB6479A86CC43D17D90F1E89 /* Pods-ServiceExtension.release.xcconfig */;
656760
buildSettings = {
657761
CODE_SIGN_IDENTITY = "Apple Development";
658762
CODE_SIGN_STYLE = Manual;

Firebase.podspec

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
6565
s.subspec 'ABTesting' do |ss|
6666
ss.dependency 'Firebase/CoreOnly'
6767
ss.dependency 'FirebaseABTesting', '~> 7.10.0'
68+
# Standard platforms PLUS watchOS.
69+
ss.ios.deployment_target = '10.0'
70+
ss.osx.deployment_target = '10.12'
71+
ss.tvos.deployment_target = '10.0'
72+
ss.watchos.deployment_target = '6.0'
6873
end
6974

7075
s.subspec 'AdMob' do |ss|
@@ -101,6 +106,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
101106
s.subspec 'Database' do |ss|
102107
ss.dependency 'Firebase/CoreOnly'
103108
ss.dependency 'FirebaseDatabase', '~> 7.10.0'
109+
# Standard platforms PLUS watchOS 7.
110+
ss.ios.deployment_target = '10.0'
111+
ss.osx.deployment_target = '10.12'
112+
ss.tvos.deployment_target = '10.0'
113+
ss.watchos.deployment_target = '7.0'
104114
end
105115

106116
s.subspec 'DynamicLinks' do |ss|
@@ -151,6 +161,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
151161
s.subspec 'RemoteConfig' do |ss|
152162
ss.dependency 'Firebase/CoreOnly'
153163
ss.dependency 'FirebaseRemoteConfig', '~> 7.10.0'
164+
# Standard platforms PLUS watchOS.
165+
ss.ios.deployment_target = '10.0'
166+
ss.osx.deployment_target = '10.12'
167+
ss.tvos.deployment_target = '10.0'
168+
ss.watchos.deployment_target = '6.0'
154169
end
155170

156171
s.subspec 'Storage' do |ss|

scripts/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,14 @@ case "$product-$platform-$method" in
425425
build
426426
;;
427427

428+
WatchOSSample-*-*)
429+
RunXcodebuild \
430+
-workspace 'Example/watchOSSample/SampleWatchApp.xcworkspace' \
431+
-scheme "SampleWatchAppWatchKitApp" \
432+
"${xcb_flags[@]}" \
433+
build
434+
;;
435+
428436
Database-*-unit)
429437
pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
430438
RunXcodebuild \

scripts/install_prereqs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ case "$project-$platform-$method" in
154154
bundle exec pod install --project-directory=FirebaseSegmentation/Tests/Sample --repo-update
155155
;;
156156

157+
WatchOSSample-*)
158+
install_xcpretty
159+
bundle exec pod install --project-directory=Example/watchOSSample --repo-update
160+
;;
161+
157162
GoogleDataTransport-watchOS-xcodebuild)
158163
install_xcpretty
159164
bundle exec pod install --project-directory=GoogleDataTransport/GDTWatchOSTestApp/ --repo-update

0 commit comments

Comments
 (0)